需要一个拿到全部用户的接口

This commit is contained in:
XaoLi717 2024-11-22 10:48:40 +08:00
parent 6ee977938c
commit c036b480a8

View File

@ -103,6 +103,21 @@ public class UserController {
pageResult.getTotal()));
}
@GetMapping("/pageKQ")
@Operation(summary = "获得用户分页列表")
public CommonResult<PageResult<UserRespVO>> getUserPageKQ(@Valid UserPageReqVO pageReqVO) {
// 获得用户分页列表
PageResult<AdminUserDO> pageResult = userService.getUserPage(pageReqVO);
if (CollUtil.isEmpty(pageResult.getList())) {
return success(new PageResult<>(pageResult.getTotal()));
}
// 拼接数据
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
convertList(pageResult.getList(), AdminUserDO::getDeptId));
return success(new PageResult<>(UserConvert.INSTANCE.convertList(pageResult.getList(), deptMap),
pageResult.getTotal()));
}
@GetMapping({"/list-all-simple", "/simple-list"})
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项")
public CommonResult<List<UserSimpleRespVO>> getSimpleUserList() {