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.travelAdvance.entity.TravelAdvance;
import org.jeecg.modules.travelVolunteer.entity.TravelVolunteer;
import org.springframework.web.bind.annotation.GetMapping;
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/info")
@Slf4j
public class IndexApiController {

    @Resource
    private IndexApiService indexApiService;

    //获取小程序任一文章或服务

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


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

    //根据分类获取文章列表
    @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);
    }

    //根据景区id获取该景区下的地点列表-景点/厕所/美食店铺/民宿
    @ApiOperation(value="小程序-根据景区id获取该景区下的地点列表", notes="areaId: 0-瓷都镇区 1-湖田片区 2-高岭片区 3-瑶里片区 4-蛟潭片区; categoryTyep: 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);
    }


    /*//我的收藏
    @ApiOperation(value="小程序-获取我的收藏列表", notes="小程序-获取我的收藏列表")
    @RequestMapping(value = "/queryCollection", method = {RequestMethod.GET})
    public Result<?> queryCollection(String experienceId, PageBean pageBean){
        return indexApiService.queryCollection(experienceId, pageBean);
    }

    //我的预约
    @ApiOperation(value="小程序-获取我的预约列表", notes="小程序-获取我的预约列表")
    @RequestMapping(value = "/queryPreOrder", method = {RequestMethod.GET})
    public Result<?> queryPreOrder(String preOrderType, PageBean pageBean){
        return indexApiService.queryPreOrder(preOrderType, pageBean);
    }*/

    //文创好物-待补充

    //瓷都美食-链接美团

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

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

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

    /*************************我的***********************************/
    //添加志愿者
    @ApiOperation(value="小程序-添加志愿者", notes="小程序-添加志愿者")
    @RequestMapping(value = "/addVolunteer", method = {RequestMethod.POST})
    public Result<?> addVolunteer(TravelVolunteer travelVolunteer){
        return indexApiService.addVolunteer(travelVolunteer);
    }


}
