package org.jeecg.modules.api.employController;

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.BossApiService;
import org.jeecg.modules.employContract.entity.EmployContract;
import org.jeecg.modules.employJob.entity.EmployJob;
import org.jeecg.modules.employResume.entity.EmployResume;
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;
import javax.servlet.http.HttpServletRequest;

@Api(tags="小程序-Boss相关接口")
@RestController
@RequestMapping("/api/boss")
@Slf4j
public class BossApiController {
    /******************************Boss-首页相关接口********************************************/
    //首页相关接口
    @Resource
    private BossApiService bossApiService;

    //首页-
    @ApiOperation(value="首页-获取简历列表", notes="首页-获取简历列表")
    @RequestMapping(value = "/queryResumeListByAll", method = {RequestMethod.GET})
    public Result<?> queryResumeListByAll(EmployResume employResume, PageBean pageBean, HttpServletRequest req){
        return bossApiService.queryResumeListByAll(employResume, pageBean, req);
    }

    //首页-根据Id查看简历详情
    @ApiOperation(value="首页-根据Id查看简历详情", notes="首页-根据Id查看简历详情")
    @RequestMapping(value = "/queryResumeById", method = {RequestMethod.GET})
    public Result<?> queryResumeById(String token, String resumeId){
        return bossApiService.queryResumeById(token, resumeId);
    }

    //首页-发布招工
    @ApiOperation(value="首页-发布招工", notes="首页-发布招工")
    @RequestMapping(value = "/addJob", method = {RequestMethod.POST})
    public Result<?> addJob(EmployJob employJob){
        return bossApiService.addJob(employJob);
    }

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

    @ApiOperation(value="会员中心-我的收藏(数量统计)", notes="会员中心-我的收藏(数量统计)")
    @RequestMapping(value = "/queryCollectionCount", method = {RequestMethod.GET})
    public Result<?> queryCollectionCount(@RequestHeader("X-Access-Token") String token){
        return bossApiService.queryJobCollectionCount(token);
    }

    //会员中心-联系记录-我看过谁
    @ApiOperation(value="会员中心-联系记录-我看过谁", notes="会员中心-联系记录-我看过谁")
    @RequestMapping(value = "/queryWatchWho", method = {RequestMethod.GET})
    public Result<?> queryWatchWho(@RequestHeader("X-Access-Token") String token, PageBean pageBean){
        return bossApiService.queryWatchWho(token, pageBean);
    }

    //会员中心-联系记录-我看过谁(数量统计)
    @ApiOperation(value="会员中心-联系记录-我看过谁(数量统计)", notes="会员中心-联系记录-我看过谁(数量统计)")
    @RequestMapping(value = "/queryWatchWhoCount", method = {RequestMethod.GET})
    public Result<?> queryWatchWhoCount(@RequestHeader("X-Access-Token") String token){
        return bossApiService.queryWatchWhoCount(token);
    }

    //会员中心-联系记录-谁看过我(谁看过我的招工)
    @ApiOperation(value="会员中心-联系记录-谁看过我(谁看过我的招工)", notes="会员中心-联系记录-谁看过我(谁看过我的招工)")
    @RequestMapping(value = "/queryWatchMe", method = {RequestMethod.GET})
    public Result<?> queryWatchMe(@RequestHeader("X-Access-Token") String token, PageBean pageBean){
        return bossApiService.queryWatchMe(token, pageBean);
    }

    //会员中心-联系记录-谁看过我(数量统计)
    @ApiOperation(value="会员中心-联系记录-谁看过我(数量统计)", notes="会员中心-联系记录-谁看过我(数量统计)")
    @RequestMapping(value = "/queryWatchMeCount", method = {RequestMethod.GET})
    public Result<?> queryWatchMeCount(@RequestHeader("X-Access-Token") String token){
        return bossApiService.queryWatchMeCount(token);
    }

    //会员中心-我的招工
    @ApiOperation(value="会员中心-我的招工", notes="会员中心-我的招工")
    @RequestMapping(value = "/queryJobListByUserId", method = {RequestMethod.GET})
    public Result<?> queryJobListByUserId(@RequestHeader("X-Access-Token")String token, PageBean pageBean){
        return bossApiService.queryJobListByUserId(token, pageBean);
    }

    //我的服务-电子合同
    @ApiOperation(value="电子合同-获取电子合同列表", notes="电子合同-获取电子合同列表")
    @RequestMapping(value = "/queryContractList", method = {RequestMethod.GET})
    public Result<?> queryContractList(@RequestHeader("X-Access-Token")String token, EmployContract employContract, PageBean pageBean){
        return bossApiService.queryContractList(token, employContract, pageBean);
    }

    //我的服务-电子合同
    @ApiOperation(value="电子合同-根据id查询电子合同详情", notes="电子合同-根据id查询电子合同详情")
    @RequestMapping(value = "/queryContracById", method = {RequestMethod.GET})
    public Result<?> queryContracById(@RequestHeader("X-Access-Token") String token, String contractId){
        return bossApiService.queryContracById(token, contractId);
    }



}
