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.ResumeService;
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;

@Api(tags="简历信息相关接口")
@RestController
@RequestMapping("/employ/resume")
@Slf4j
public class ResumeController {

    /******************************************************************************************************************/
    //简历信息
    @Resource
    private ResumeService resumeService;
    /******************************************************************************************************************/
    //查看工作列表
    @ApiOperation(value="首页-查询简历信息列表", notes="首页-查询简历信息列表")
    @RequestMapping(value = "/queryResumeList", method = {RequestMethod.GET})
    public Result<?> queryResumeList(EmployResume employResume, PageBean pageBean){
        return resumeService.queryResumeList(employResume, pageBean);
    }

    //首页-根据Id查看工作详情
    @ApiOperation(value="首页-根据Id查看简历详情", notes="首页-根据Id查看简历详情")
    @RequestMapping(value = "/queryResumeById", method = {RequestMethod.GET})
    public Result<?> queryResumeById(@RequestHeader("X-Access-Token")String token, String jobId){
        return resumeService.queryResumeById(token, jobId);
    }

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

    //添加工作信息
    @ApiOperation(value="首页-添加简历信息", notes="首页-添加简历信息")
    @RequestMapping(value = "/addResume", method = {RequestMethod.POST})
    public Result<?> addResume(@RequestHeader("X-Access-Token")String token, EmployResume employResume){
        return resumeService.addResume(token, employResume);
    }

    //修改工作信息
    @ApiOperation(value="首页-修改简历信息", notes="首页-修改简历信息")
    @RequestMapping(value = "/updateResume", method = {RequestMethod.POST})
    public Result<?> updateResume(@RequestHeader("X-Access-Token") String token, EmployResume employResume){
        return resumeService.updateResume(token, employResume);
    }

}
