71 lines
2.4 KiB
Java
71 lines
2.4 KiB
Java
package com.newyetai.recruit.position.controller;
|
|
|
|
|
|
|
|
import com.newyetai.common.AlitaResult;
|
|
import com.newyetai.recruit.position.dto.PositionFileDTO;
|
|
import com.newyetai.recruit.position.dto.PositionFilePageQueryDTO;
|
|
import com.newyetai.recruit.position.entity.PositionFile;
|
|
import com.newyetai.recruit.position.service.PositionFileService;
|
|
import com.newyetai.tkmybatis.pojo.Page;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
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.PutMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
@Api(tags = "岗位附件")
|
|
@RestController
|
|
@RequestMapping("/position/file")
|
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
|
public class HrPositionFileController {
|
|
|
|
|
|
private final PositionFileService positionFileService;
|
|
|
|
@GetMapping("/page")
|
|
@ApiOperation("分页查询岗位文件")
|
|
public AlitaResult<Page<PositionFileDTO>> filePage(PositionFilePageQueryDTO queryDTO) {
|
|
positionFileService.filePage(queryDTO);
|
|
return AlitaResult.success(queryDTO.getPageResult());
|
|
}
|
|
|
|
@PostMapping("/create")
|
|
@ApiOperation("创建岗位文件信息")
|
|
public AlitaResult<PositionFile> create(@RequestBody PositionFileDTO queryDTO) {
|
|
return AlitaResult.success(positionFileService.create(queryDTO));
|
|
}
|
|
|
|
@PostMapping("/update")
|
|
@ApiOperation("修改岗位文件信息")
|
|
public AlitaResult<Void> update(@RequestBody PositionFileDTO queryDTO) {
|
|
positionFileService.update(queryDTO);
|
|
return AlitaResult.success();
|
|
}
|
|
|
|
@DeleteMapping("/delete/{id}")
|
|
@ApiOperation("根据文件Id删除企业文件信息")
|
|
public AlitaResult<Void> delete(@PathVariable("id") Long id) {
|
|
positionFileService.delete(id);
|
|
return AlitaResult.success();
|
|
}
|
|
|
|
@PutMapping("/setDefault/{id}")
|
|
@ApiOperation("设置为默认")
|
|
public AlitaResult<Void> setDefault(@PathVariable("id") Long id) {
|
|
positionFileService.setDefault(id);
|
|
return AlitaResult.success();
|
|
}
|
|
|
|
}
|
|
|