56 lines
1.6 KiB
Java
56 lines
1.6 KiB
Java
package com.bwie.controller;
|
|
|
|
import com.bwie.common.domain.request.RecruitmentListReq;
|
|
import com.bwie.common.domain.response.RecruitmentListResp;
|
|
import com.bwie.common.result.Result;
|
|
import com.bwie.service.RecruitmentService;
|
|
import lombok.extern.log4j.Log4j2;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
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 java.util.List;
|
|
|
|
@RestController
|
|
@Log4j2
|
|
@RequestMapping("recruitment")
|
|
public class RecruitmentController {
|
|
|
|
@Autowired
|
|
private RecruitmentService recruitmentService;
|
|
|
|
/**
|
|
* 查询招聘信息
|
|
* @param req
|
|
* @return
|
|
*/
|
|
@PostMapping("findList")
|
|
public Result findList(@RequestBody RecruitmentListReq req){
|
|
List<RecruitmentListResp> list = recruitmentService.findList(req);
|
|
return Result.success(list);
|
|
}
|
|
|
|
/**
|
|
* 最近招聘信息
|
|
* @return
|
|
*/
|
|
@PostMapping("latest")
|
|
public Result latest(){
|
|
List<RecruitmentListResp> list = recruitmentService.latest();
|
|
return Result.success(list);
|
|
}
|
|
|
|
/**
|
|
* 定时将失效的岗位状态修改为已过期
|
|
*/
|
|
@Scheduled(cron = "0 0/1 * * * ?")
|
|
public void scheduledUpdStatus() {
|
|
log.info("定时器开始执行");
|
|
recruitmentService.scheduledUpdStatus();
|
|
log.info("定时器执行完毕");
|
|
}
|
|
}
|