jinlin
2024-02-23 1772fc5e211f9e9e0ab4cdc6c29b436aac178c2a
zt/core/src/main/java/com/zt/modules/sys/controller/SysUserController.java
@@ -103,17 +103,7 @@
    @ApiOperation("信息")
    @RequiresPermissions("sys:user:info")
    public Result<SysUser> get(@PathVariable("id") Long id) {
        SysUser data = sysUserService.get(id);
        if (data != null) {
            OssDto ossDto= sysOssConfigService.getOssByBusiType(data.getId() , "users_avatar");
            if (ossDto != null) {
                data.setFiles(ossDto);
            }
            OssDto ossDto2= sysOssConfigService.getOssByBusiType(data.getId() , "users_sign");
            if (ossDto2 != null) {
                data.setFiles2(ossDto2);
            }
        }
        SysUser data = sysUserService.getUserInfo(id);
        // 用户岗位列表
        data.setPostIdList(sysPostUserService.getUserPosts(id).stream().map(post -> post.getId())
                .collect(Collectors.toList()));
@@ -230,7 +220,6 @@
    @ApiOperation("用户角色列表")
    @RequiresPermissions("sys:user:role")
    public Result<List<Long>> getRole(@PathVariable("id") Long id) {
        return Result.ok(sysRoleUserService.getUserRoles(id).stream().map(role -> role.getId())
                .collect(Collectors.toList()));
    }
@@ -242,4 +231,10 @@
        sysRoleUserService.saveOrUpdate(dto.getUserId(), dto.getRoleIdList());
        return Result.ok();
    }
    @PostMapping("getNameById")
    @ApiOperation("用户名")
    public Result getNameById(@RequestBody String ids) {
        sysUserService.getNames(ids);
        return Result.ok();
    }
}