package org.jeecg.modules.api.carrentController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiBean.PageBean;
import org.jeecg.modules.apiService.NewsService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags="新闻资讯相关接口")
@RestController
@RequestMapping("/api/news")
@Slf4j
public class NewsController {

    //新闻信息
    @Resource
    private NewsService newsService;
    /****************************************************************************************************/

    @ApiOperation(value="新闻资讯-获取新闻列表", notes="新闻资讯-获取新闻列表")
    @RequestMapping(value = "/queryNewsList", method = {RequestMethod.GET})
    public Result<?> queryNewsList(PageBean pageBean){
        return newsService.queryNewsList(pageBean);
    }

    @ApiOperation(value="新闻资讯-根据id获取新闻详情", notes="新闻资讯-根据id获取新闻详情")
    @RequestMapping(value = "/queryNewsById", method = {RequestMethod.GET})
    public Result<?> queryNewsById(String newsId){
        return newsService.queryNewsById(newsId);
    }

}
