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

import cn.com.ty.lift.ud.common.BaseController;
import cn.com.ty.lift.ud.recruitmentInfos.controller.query.RecruitmentDeliveryQuery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

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

/**
 * 招聘投递信息 API
 * 
 * @author Xson
 * @date 2020-04-23
 */
@Api(tags = "招聘投递信息 API- 魏瑞锋")
@RestController
@RequestMapping("/api/recruitmentDeliverys")
public class RecruitmentDeliveryController extends BaseController<RecruitmentDeliveryEntity, RecruitmentDeliveryQuery> {

    private final Logger log = LoggerFactory.getLogger(RecruitmentDeliveryController.class);
    
    private @Autowired IRecruitmentDeliveryService recruitmentDeliveryService;

    @Override
    protected IService<RecruitmentDeliveryEntity> getService() {
        return recruitmentDeliveryService;
    }
    
    @PostMapping("/query-page")
    @ApiOperation(value = "分页查询")
    @Override
    public RestResponse getCondition(@RequestBody RecruitmentDeliveryQuery request) {
        return recruitmentDeliveryService.selectByExample(request);
    }
    
    @GetMapping("/query/{id}")
    @ApiOperation(value = "获取详情")
    @Override
    public RestResponse get(@PathVariable("id")  Long id) {
        return recruitmentDeliveryService.finOneById(id);
    }
}