| | |
| | | @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"); |
| | | if (ossDto != null) { |
| | | data.setFiles(ossDto); |
| | | } |
| | | } |
| | | SysUser data = sysUserService.getUserInfo(id); |
| | | // 用户岗位列表 |
| | | data.setPostIdList(sysPostUserService.getUserPosts(id).stream().map(post -> post.getId()) |
| | | .collect(Collectors.toList())); |
| | |
| | | @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())); |
| | | } |
| | |
| | | sysRoleUserService.saveOrUpdate(dto.getUserId(), dto.getRoleIdList()); |
| | | return Result.ok(); |
| | | } |
| | | @PostMapping("getNameById") |
| | | @ApiOperation("用户名") |
| | | public Result getNameById(@RequestBody String ids) { |
| | | sysUserService.getNames(ids); |
| | | return Result.ok(); |
| | | } |
| | | } |