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.ActivityService;
import org.jeecg.modules.api.service.IndexService;
import org.jeecg.modules.studytourActivity.entity.StudytourActivity;
import org.jeecg.modules.studytourBanner.entity.StudytourBanner;
import org.springframework.web.bind.annotation.RequestHeader;
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/activity")
@Slf4j
public class ActivityController {

    /******************************************************************************************************************/
    @Resource
    private ActivityService activityService;
    /******************************************************************************************************************/

    @ApiOperation(value="首页&分类-查询研学活动列表", notes="首页&分类-查询研学活动列表")
    @RequestMapping(value = "/queryActivityList", method = {RequestMethod.GET})
    public Result<?> queryActivityList(StudytourActivity activity, PageBean pageBean){
        return activityService.queryActivityList(activity, pageBean);
    }

    @ApiOperation(value="首页&分类-查询研学活动详情", notes="首页&分类-查询研学活动详情")
    @RequestMapping(value = "/queryActivityById", method = {RequestMethod.GET})
    public Result<?> queryActivityById(String activityId){
        return activityService.queryActivityById(activityId);
    }

    @ApiOperation(value="首页&分类-查询我收藏的研学活动列表", notes="首页&分类-查询我收藏的研学活动列表")
    @RequestMapping(value = "/queryCollectionActivityList", method = {RequestMethod.GET})
    public Result<?> queryCollectionActivityList(@RequestHeader("X-Access-Token") String token, PageBean pageBean){
        return activityService.queryCollectionActivityList(token, pageBean);
    }

    @ApiOperation(value="首页&分类-收藏研学活动", notes="首页&分类-收藏研学活动")
    @RequestMapping(value = "/collectionActivity", method = {RequestMethod.POST})
    public Result<?> collectionActivity(@RequestHeader("X-Access-Token") String token, String activityId){
        return activityService.collectionActivity(token, activityId);
    }



}
