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.EmployeeApiService;
import org.jeecg.modules.employContract.entity.EmployContract;
import org.jeecg.modules.employJob.entity.EmployJob;
import org.jeecg.modules.employRedister.entity.EmployRedister;
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="小程序-Employee相关接口")
@RestController
@RequestMapping("/api/employee")
@Slf4j
public class EmployeeApiController {
    /******************************求职者-首页相关接口********************************************/
    //首页相关接口
    @Resource
    private EmployeeApiService employeeApiService;


    /***************首页***************/
    //首页-智能推荐查询工作信息
    @ApiOperation(value="首页-查询工作信息", notes="首页-查询工作信息")
    @RequestMapping(value = "/queryJobListByAll", method = {RequestMethod.GET})
    public Result<?> queryJobListByAll(EmployJob employJob, PageBean pageBean, HttpServletRequest req){
        return employeeApiService.queryJobListByAll(employJob, pageBean, req);
    }

    //首页-根据Id查看工作详情
    @ApiOperation(value="首页-根据Id查看工作详情", notes="首页-根据Id查看工作详情")
    @RequestMapping(value = "/queryJobById", method = {RequestMethod.GET})
    public Result<?> queryJobById(String token, String jobId){
        return employeeApiService.queryJobById(token, jobId);
    }

    //首页-发布找活
    @ApiOperation(value="首页-发布找活", notes="首页-发布找活")
    @RequestMapping(value = "/addJob", method = {RequestMethod.POST})
    public Result<?> addJob(){
        return Result.OK("接口内容暂未处理");
    }

    /***************个人简历***************/
    //个人中心-我的简历
    @ApiOperation(value="个人中心-我的简历", notes="个人中心-我的简历")
    @RequestMapping(value = "/queryResume", method = {RequestMethod.GET})
    public Result<?> queryResume(String token){
        return employeeApiService.queryResume(token);
    }

    //个人中心-修改简历
    @ApiOperation(value="个人中心-添加简历", notes="个人中心-添加简历")
    @RequestMapping(value = "/addResume", method = {RequestMethod.POST})
    public Result<?> addResume(String token, EmployResume employResume){
        return employeeApiService.addResume(token, employResume);
    }

    //个人中心-修改简历
    @ApiOperation(value="个人中心-修改简历", notes="个人中心-修改简历")
    @RequestMapping(value = "/updateResume", method = {RequestMethod.POST})
    public Result<?> updateResume(String token, EmployResume employResume){
        return employeeApiService.updateResume(token, employResume);
    }

    /***************考证咨询***************/
    //考证咨询-证书查询
    @ApiOperation(value="考证咨询-证书查询", notes="考证咨询-证书查询")
    @RequestMapping(value = "/queryCert", method = {RequestMethod.GET})
    public Result<?> queryCert(PageBean pageBean){
        return employeeApiService.queryCertList(pageBean);
    }

    //考证咨询-提交报名材料
    @ApiOperation(value="考证咨询-提交报名材料", notes="考证咨询-提交报名材料")
    @RequestMapping(value = "/addMaterial", method = {RequestMethod.POST})
    public Result<?> addMaterial(@RequestHeader("X-Access-Token") String token, EmployRedister employRedister){
        return employeeApiService.addMaterial(token, employRedister);
    }

    //考证咨询-联系客服
    @ApiOperation(value="考证咨询-联系客服", notes="考证咨询-联系客服")
    @RequestMapping(value = "/queryWorker", method = {RequestMethod.GET})
    public Result<?> queryWorker(){
        return Result.OK("客服电话","17777777777");
    }

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

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

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

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

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

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

    //会员中心-我的找活
    @ApiOperation(value="会员中心-我的找活", notes="会员中心-我的找活")
    @RequestMapping(value = "/queryResumeByUserId", method = {RequestMethod.GET})
    public Result<?> queryResumeByUserId(@RequestHeader("X-Access-Token") String token, PageBean pageBean){
        return employeeApiService.queryResumeByUserId(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 employeeApiService.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 employeeApiService.queryContracById(token, contractId);
    }

}
