package org.jeecg.modules.api.studytourController;

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.api.bean.PageBean;
import org.jeecg.modules.api.service.IndexService;
import org.jeecg.modules.studytourBanner.entity.StudytourBanner;
import org.jeecg.modules.studytourNews.entity.StudytourNews;
import org.jeecg.modules.studytourPolicy.entity.StudytourPolicy;
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("/studytour/index")
@Slf4j
public class IndexController {
    /******************************************************************************************************************/
    @Resource
    private IndexService indexService;
    /******************************************************************************************************************/

    @ApiOperation(value="首页-查询banner图列表", notes="type：0-首页顶部 1-首页中部")
    @RequestMapping(value = "/queryBannerList", method = {RequestMethod.GET})
    public Result<?> queryBannerList(StudytourBanner studytourBanner, PageBean pageBean){
        return indexService.queryBannerList(studytourBanner, pageBean);
    }

    @ApiOperation(value="首页-查询研学政策列表", notes="首页-查询研学政策列表")
    @RequestMapping(value = "/queryPolicyList", method = {RequestMethod.GET})
    public Result<?> queryPolicyList(StudytourPolicy studytourPolicy, PageBean pageBean){
        return indexService.queryPolicyList(studytourPolicy, pageBean);
    }

    @ApiOperation(value="首页-查询研学政策详情", notes="首页-查询研学政策详情")
    @RequestMapping(value = "/queryPolicyById", method = {RequestMethod.GET})
    public Result<?> queryPolicyById(String policyId){
        return indexService.queryPolicyById(policyId);
    }

    @ApiOperation(value="首页-查询公司动态列表", notes="首页-查询公司动态列表")
    @RequestMapping(value = "/queryNewsList", method = {RequestMethod.GET})
    public Result<?> queryNewsList(StudytourNews studytourNews, PageBean pageBean){
        return indexService.queryNewsList(studytourNews, pageBean);
    }

    @ApiOperation(value="首页-查询公司动态详情", notes="首页-查询公司动态详情")
    @RequestMapping(value = "/queryNewsById", method = {RequestMethod.GET})
    public Result<?> queryNewsById(String newsId){
        return indexService.queryNewsById(newsId);
    }



}
