package cn.com.ty.lift.ud.userresume.controller;

import cn.com.ty.lift.ud.userresume.controller.query.UserResumeQuery;
import cn.com.ty.lift.ud.userresume.service.IUserResumeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.baomidou.mybatisplus.extension.service.IService;

import cn.com.ty.lift.ud.common.BaseController;
import cn.com.ty.lift.ud.recruitmentInfos.mapper.entity.RecruitmentDeliveryEntity;
import cn.com.ty.lift.ud.recruitmentInfos.service.IRecruitmentDeliveryService;
import cn.com.ty.lift.ud.userresume.mapper.entity.UserResume;
import cn.com.xwy.boot.web.dto.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 用户简历信息 API
 * 
 * @author Xson
 * @date 2020-04-24
 */
@Api(tags = "用户简历信息 API- 魏瑞锋")
@RestController
@RequestMapping("/api/userResumes")
public class UserResumeController extends BaseController<UserResume, UserResumeQuery> {

    private final Logger log = LoggerFactory.getLogger(UserResumeController.class);

    @Autowired
    private IUserResumeService userResumeService;


    @Override
    protected IService<UserResume> getService() {
        return userResumeService;
    }
    
    @PostMapping("/applyJob")
    @ApiOperation(value = "申请职位")
    public RestResponse<UserResume> applyJob(@RequestBody UserResume entity) {

        return userResumeService.applyJob(entity);
    }

    @GetMapping("/getResumeByUserId")
    @ApiOperation(value = "申请职位")
    public RestResponse<UserResume> getResumeByUserId(Long userId) {

        return userResumeService.getResumeByUserId(userId);
    }
}