luoyb
2021-05-31 3ae6bd194fe1f17b4f5d96cb78b057705e5d0d78
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/controller/EmpAccessoryController.java
@@ -36,7 +36,6 @@
    private final IEmpAccessoryService empAccessoryService;
    @GetMapping
    @PreAuthorize("hasAuthority('empAccessory:list')")
    public FebsResponse getAllEmpAccessorys(EmpAccessory empAccessory) {
        return new FebsResponse().data(empAccessoryService.findEmpAccessorys(empAccessory));
    }
@@ -49,7 +48,6 @@
    }
    @PostMapping
    @PreAuthorize("hasAuthority('empAccessory:add')")
    public void addEmpAccessory(@NotNull(message = "{required}") Long labelid,@NotNull(message = "{required}") Long empId, MultipartFile file) throws FebsException {
        try {
            this.empAccessoryService.createEmpAccessory(labelid,file,empId);
@@ -80,7 +78,7 @@
        } catch (Exception e) {
            String message = "修改EmpAccessory失败";
            log.error(message, e);
            throw new FebsException(message);
            throw new FebsException(e.getMessage());
        }
    }
@@ -129,4 +127,27 @@
            throw new FebsException(message);
        }
    }
    @PostMapping("autoInstall")
    public void autoInstall(  String fileids) throws FebsException {
        try {
            this.empAccessoryService.autoInstall(fileids);
        } catch (Exception e) {
            String message = "插入文件失败";
            log.error(message, e);
            throw new FebsException(message);
        }
    }
    @GetMapping("image/{accessoryid}")
    public void getImage(@PathVariable String accessoryid, HttpServletResponse response) throws FebsException {
        try {
            this.empAccessoryService.getImage(accessoryid,response);
        } catch (Exception e) {
            String message = "获取员工图片异常";
            log.error(message, e);
            throw new FebsException(message);
        }
    }
}