package cn.iocoder.yudao.module.hrm.controller.admin.employee;
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.module.hrm.controller.admin.employee.vo.HrmEmployeeEducationRespVO;
|
import cn.iocoder.yudao.module.hrm.dal.dataobject.employee.HrmEmployeeEducationDO;
|
import cn.iocoder.yudao.module.hrm.service.employee.HrmEmployeeEducationService;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import jakarta.annotation.Resource;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
@Tag(name = "管理后台 - HRM 员工教育经历")
|
@RestController
|
@RequestMapping("/hrm/employee/education")
|
@Validated
|
public class HrmEmployeeEducationController {
|
|
@Resource
|
private HrmEmployeeEducationService educationService;
|
|
@GetMapping("/list")
|
@Operation(summary = "获取教育经历列表")
|
@Parameter(name = "employeeId", description = "员工ID", required = true)
|
@PreAuthorize("@ss.hasPermission('hrm:employee:query')")
|
public CommonResult<List<HrmEmployeeEducationRespVO>> getEducationList(
|
@RequestParam("employeeId") Long employeeId) {
|
List<HrmEmployeeEducationDO> list = educationService.getEducationListByEmployeeId(employeeId);
|
return success(BeanUtils.toBean(list, HrmEmployeeEducationRespVO.class));
|
}
|
|
@DeleteMapping("/delete")
|
@Operation(summary = "删除教育经历")
|
@Parameter(name = "id", description = "教育经历ID", required = true)
|
@PreAuthorize("@ss.hasPermission('hrm:employee:delete')")
|
public CommonResult<Boolean> deleteEducation(@RequestParam("id") Long id) {
|
educationService.deleteEducation(id);
|
return success(true);
|
}
|
|
}
|