package com.yanzhu.jh.bigscreen.web.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.yanzhu.jh.work.service.IWorkJournalismService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 集团新闻Conller
 */
@RestController
@RequestMapping("/bgscreen/journalism")
public class JournalismConller extends BaseController {

    @Autowired
    IWorkJournalismService workJournalismService;

    /**
     * 查询集团新闻列表
     * @return TableDataInfo
     */
    @GetMapping("/getJournalismList")
    public TableDataInfo getJournalismList(){
        return getDataTable(workJournalismService.selectBgscreenWorkJournalismList());
    }

    /**
     * 查询集团新闻详情
     * @return AjaxResult
     */
    @GetMapping("/getJournalismInfo")
    public AjaxResult getJournalismInfo(Long id){
        return success(workJournalismService.selectWorkJournalismById(id));
    }
}
