9 天以前 8c14b50773a1e582b652c03f5a63bb2233d069b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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);
    }
 
}