package org.jeecg.modules.api.controller2;

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.CollectionService;
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("/employ/collection")
@Slf4j
public class CollectionController {

    /******************************************************************************************************************/
    //收藏信息
    @Resource
    private CollectionService collectionService;
    /******************************************************************************************************************/

    //会员中心-我的收藏
    @ApiOperation(value="我的收藏-收藏工作信息列表", notes="我的收藏-收藏工作信息列表")
    @RequestMapping(value = "/queryJobCollectionList", method = {RequestMethod.GET})
    public Result<?> queryJobCollectionList(@RequestHeader("X-Access-Token") String token, PageBean pageBean){
        return collectionService.queryJobCollectionList(token, pageBean);
    }

    @ApiOperation(value="我的收藏-添加工作收藏", notes="我的收藏-添加工作收藏")
    @RequestMapping(value = "/addJobCollection", method = {RequestMethod.POST})
    public Result<?> addJobCollection(@RequestHeader("X-Access-Token") String token, String jobId){
        return collectionService.addJobCollection(token, jobId);
    }

    //会员中心-我的收藏
    @ApiOperation(value="我的收藏-收藏简历信息列表", notes="我的收藏-收藏简历信息列表")
    @RequestMapping(value = "/queryResumeCollectionList", method = {RequestMethod.GET})
    public Result<?> queryResumeCollectionList(@RequestHeader("X-Access-Token") String token, PageBean pageBean){
        return collectionService.queryResumeCollectionList(token, pageBean);
    }

    //会员中心-我的收藏
    @ApiOperation(value="我的收藏-添加简历收藏", notes="我的收藏-添加简历收藏")
    @RequestMapping(value = "/addResumeCollection", method = {RequestMethod.POST})
    public Result<?> addResumeCollection(@RequestHeader("X-Access-Token") String token, String resumeId){
        return collectionService.addResumeCollection(token, resumeId);
    }

}
