package org.jeecg.modules.api.travelController;

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.IndexApiService;
import org.jeecg.modules.apiService.OrderApiService;
import org.jeecg.modules.travelAdvance.entity.TravelAdvance;
import org.jeecg.modules.travelCollection.entity.TravelCollection;
import org.jeecg.modules.travelShopcar.entity.TravelShopcar;
import org.jeecg.modules.travelVolunteer.entity.TravelVolunteer;
import org.jeecg.modules.travelWaresOrder.entity.TravelWaresOrder;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@Api(tags="小程序-首页相关接口")
@RestController
@RequestMapping("/api/info")
@Slf4j
public class IndexApiController {

    //首页相关接口
    @Resource
    private IndexApiService indexApiService;

    //订单相关接口
    @Resource
    private OrderApiService orderApiService;

    /**************首页*********************/
    //获取banner图列表
    @ApiOperation(value="小程序-获取banner图列表", notes="0-首页 1-遗产路径 2-我要跟拍 3-非遗体验 4-无忧服务 5-申遗历程 6-遗产概况")
    @GetMapping()
    @RequestMapping(value = "/queryBannerList", method = {RequestMethod.GET})
    public Result<?> queryBannerList(String bannerCategoryType){
        return indexApiService.queryBannerList(bannerCategoryType);
    };

    //获取小程序任一文章或服务
    @ApiOperation(value="小程序-首页搜索栏", notes="小程序-根据标题模糊查询文章")
    @RequestMapping(value = "/queryArticleListByTitle", method = {RequestMethod.GET})
    public Result<?> queryArticleListByTitle(String articleTitle, PageBean pageBean){
        return indexApiService.queryArticleListByTitle(articleTitle, pageBean);
    }

    //根据角色id获取视频列表带分页
    @ApiOperation(value="首页-根据角色id获取视频列表", notes="首页-根据角色id获取视频列表")
    @RequestMapping(value = "/queryVedioById", method = {RequestMethod.GET})
    public Result<?> queryVedioById(String token, String roleInfoId, PageBean pageBean){
        return indexApiService.queryVedioById(token, roleInfoId, pageBean);
    }

    //根据id给视频点赞
    @ApiOperation(value="首页-根据id给视频点赞", notes="首页-根据id给视频点赞")
    @RequestMapping(value = "/addThumpup", method = {RequestMethod.POST})
    public Result<?> addThumpup(@RequestHeader("X-Access-Token") String token, String videoId){
        return indexApiService.addThumpup(token, videoId);
    }

    /**************申遗新闻*********************/
//    //获取新闻分类列表
//    @ApiOperation(value="申遗新闻-获取新闻分类列表", notes="申遗新闻-获取新闻分类列表")
//    @RequestMapping(value = "/queryNewsTypeList", method = {RequestMethod.GET})
//    public Result<?> queryNewsTypeList(PageBean pageBean){
//        return indexApiService.queryNewsTypeList(pageBean);
//    }

    //根据分类获取新闻列表
    @ApiOperation(value="申遗新闻-根据分类获取新闻列表", notes="申遗新闻-根据分类获取新闻列表")
    @RequestMapping(value = "/queryNewsByType", method = {RequestMethod.GET})
    public Result<?> queryNewsByType(PageBean pageBean){
        return indexApiService.queryNewsListByType(pageBean);
    }

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

    /**************申遗历程*********************/
    //根据分类获取文章列表
    @ApiOperation(value="申遗历程-根据分类获取文章列表", notes="0-申遗历程 1-申遗缘由 2-遗产价值")
    @RequestMapping(value = "/queryArticleListByType", method = {RequestMethod.GET})
    public Result<?> queryArticleListByType(String articleType, PageBean pageBean){
        return indexApiService.queryArticleListByType(articleType, pageBean);
    }

    //根据id获取文章详情
    @ApiOperation(value="申遗历程-根据id获取文章详情", notes="申遗历程-根据id获取文章详情")
    @RequestMapping(value = "/queryArticleById", method = {RequestMethod.GET})
    public Result<?> queryArticleById(String articleId){
        return indexApiService.queryArticleById(articleId);
    }

    /**************遗产概况*********************/
    //获取景区列表
    @ApiOperation(value="遗产概况-获取景区列表", notes="遗产概况-获取景区列表")
    @RequestMapping(value = "/queryAreaList", method = {RequestMethod.GET})
    public Result<?> queryAreaList(PageBean pageBean){
        return indexApiService.queryAreaList(pageBean);
    }

    //获取景区详情
    @ApiOperation(value="遗产概况-根据id获取景区详情", notes="遗产概况-根据id获取景区详情")
    @RequestMapping(value = "/queryAreaListById", method = {RequestMethod.GET})
    public Result<?> queryAreaListById(String areaId){
        return indexApiService.queryAreaListById(areaId);
    }

    /**************遗产讲述/达人同游/我要跟拍*********************/
    //根据角色类型获取角色信息列表-讲解员/达人/摄影师
    @ApiOperation(value="遗产讲述&&达人同游&&我要跟拍-根据角色类型获取角色信息列表", notes="level: 1-金牌讲解员， 2-专业讲解员; roleId: 0-讲解员，1-达人，2-摄影师")
    @RequestMapping(value = "/queryRoleInfoList", method = {RequestMethod.GET})
    public Result<?> queryRoleInfoList(String roleId, String level, String spot, PageBean pageBean){
        return indexApiService.queryRoleInfoList(roleId, level, spot, pageBean);
    }

    //根据角色id获取角色信息详情
    @ApiOperation(value="遗产讲述&&达人同游&&我要跟拍-根据角色Id获取角色信息详情", notes="遗产讲述/达人同游/我要更拍-根据角色Id获取角色信息详情")
    @RequestMapping(value = "/queryRoleInfoById", method = {RequestMethod.GET})
    public Result<?> queryRoleInfoById(String token, String roleInfoId){
        return indexApiService.queryRoleInfoById(token, roleInfoId);
    }

    /**************遗产路径/我要研学*********************/
    //遗产路径/我要研学列表
    @ApiOperation(value="遗产路径&&我要研学列表-获取游玩项目列表", notes="amusementType:0-遗产路径 1-我要研学；isPay:0-免费 1-付费")
    @RequestMapping(value = "/queryAmusementList", method = {RequestMethod.GET})
    public Result<?> queryAmusementList(String amusementType, String isPay, PageBean pageBean){
        return indexApiService.queryAmusementList(amusementType, isPay, pageBean);
    }

    //遗产路径/我要研学详情
    @ApiOperation(value="遗产路径&&我要研学列表-根据id获取游玩项目详情", notes="遗产路径/我要研学列表-根据id获取游玩项目详情")
    @RequestMapping(value = "/queryAmusementById", method = {RequestMethod.GET})
    public Result<?> queryAmusementById(String token, String amusementId){
        return indexApiService.queryAmusementById(token, amusementId);
    }

    /**************非遗体验*********************/
    //非遗列表
    @ApiOperation(value="非遗体验-获取非遗体验列表", notes="非遗体验-获取非遗体验列表")
    @RequestMapping(value = "/queryExperienceList", method = {RequestMethod.GET})
    public Result<?> queryExperienceList(PageBean pageBean){
        return indexApiService.queryExperienceList(pageBean);
    }

    //非遗体验详情
    @ApiOperation(value="非遗体验-根据id获取非遗体验详情", notes="非遗体验-根据id获取非遗体验详情")
    @RequestMapping(value = "/queryExperienceById", method = {RequestMethod.GET})
    public Result<?> queryExperienceById(String token, String experienceId){
        return indexApiService.queryExperienceById(token, experienceId);
    }

    /**************文创好物*********************/
    //获取文创好物列表
    @ApiOperation(value="文创好物-获取商品列表", notes="文创好物-获取商品列表")
    @RequestMapping(value = "/queryWaresList", method = {RequestMethod.GET})
    public Result<?> queryWaresList(PageBean pageBean){
        return indexApiService.queryWaresList(pageBean);
    }

    //获取文创好物详情
    @ApiOperation(value="文创好物-获取商品详情", notes="文创好物-获取商品详情")
    @RequestMapping(value = "/queryWaresById", method = {RequestMethod.GET})
    public Result<?> queryWaresById(String token, String waresId){
        return indexApiService.queryWaresById(token, waresId);
    }

    //查询文创好物订单信息
    @ApiOperation(value="文创好物-查询文创好物订单列表", notes="文创好物-查询文创好物订单列表")
    @RequestMapping(value = "/queryWaresOrderList", method = {RequestMethod.GET})
    public Result<?> queryWaresOrderList(@RequestHeader("X-Access-Token") String token, String status, PageBean pageBean){
        return indexApiService.queryWaresOrderList(token, status, pageBean);
    }

    //查询文创好物订单详情
    @ApiOperation(value="文创好物-查询文创好物订单详情", notes="文创好物-查询文创好物订单详情")
    @RequestMapping(value = "/queryWaresOrderById", method = {RequestMethod.GET})
    public Result<?> queryWaresOrderById(@RequestHeader("X-Access-Token") String token, String waresOrderId){
        return indexApiService.queryWaresOrderById(token, waresOrderId);
    }

    //创建文创好物订单
    @ApiOperation(value = "文创好物-创建文创好物订单",notes = "文创好物-创建文创好物订单")
    @PostMapping("/addWaresOrder")
    public Result<?> addWaresOrder(@RequestHeader("X-Access-Token") String token, TravelWaresOrder travelWaresOrder){
        return indexApiService.addWaresOrder(token, travelWaresOrder);
    }

    //立即支付
    @ApiOperation(value = "立即支付",notes = "立即支付")
    @PostMapping("/payOrder")
    public Result<?> payOrder(){
        return orderApiService.payOrder();
    }

    /**************我要帮助*********************/
    //我要帮助
    @ApiOperation(value="首页-我要帮助", notes="添加问题和意见")
    @RequestMapping(value = "/addAdvice", method = {RequestMethod.POST})
    public Result<?> addAdvice(TravelAdvance travelAdvance){
        return indexApiService.addAdvice(travelAdvance);
    }

    /**************导览*********************/
    //根据景区id获取该景区下的地点列表-景点/厕所/美食店铺/民宿
    @ApiOperation(value="导览-获取该景区下的地点列表", notes="areaId: 0-瓷都镇区 1-湖田片区 2-高岭片区 3-瑶里片区 4-蛟潭片区; categoryId: 0-景点 1-美食店铺 2-民宿 3-厕所")
    @RequestMapping(value = "/querySpotList", method = {RequestMethod.GET})
    public Result<?> querySpotList(String areaId, String categoryId, PageBean pageBean){
        return indexApiService.querySpotList(areaId, categoryId, pageBean);
    }

    //根据id获取地点详情
    @ApiOperation(value="导览-根据id获取地点详情", notes="导览-根据id获取地点详情")
    @RequestMapping(value = "/querySpotById", method = {RequestMethod.GET})
    public Result<?> querySpotById(String spotId){
        return indexApiService.querySpotById(spotId);
    }

    //语音播放
    @ApiOperation(value="小程序-语音播放", notes="小程序-语音播放")
    @RequestMapping(value = "/textToAudio", method = {RequestMethod.GET})
    public Result<?> textToAudio(String text){
        return indexApiService.textToAudio(text);
    }


    /**************系统配置信息*********************/
    //查询系统配置信息列表
    @ApiOperation(value="系统配置-查询系统配置信息列表", notes="系统配置-查询系统配置信息列表")
    @RequestMapping(value = "/queryConfigList", method = {RequestMethod.GET})
    public Result<?> queryConfigList(){
        return indexApiService.queryConfigList();
    }

    //查询系统配置信息详情
    @ApiOperation(value="系统配置-查询系统配置信息详情", notes="系统配置-查询系统配置信息详情")
    @RequestMapping(value = "/queryConfigByParamCode", method = {RequestMethod.GET})
    public Result<?> queryConfigByParamCode(String paramCode){
        return indexApiService.queryConfigByParamCode(paramCode);
    }





    //添加购物车


    //文创好物-待补充

    //瓷都美食-链接美团

    //精品民宿-链接高德地图

    //无忧租车-链接滴滴打车


}
