|
|
@@ -99,6 +99,25 @@ public class AppApiUserController {
|
|
|
// return success(convert);
|
|
|
// }
|
|
|
|
|
|
+ @GetMapping("/get-by-role")
|
|
|
+ @Operation(summary = "根据角色编码获取用户")
|
|
|
+ //
|
|
|
+ public CommonResult<PageResult<UserRespVO>> getUserByRoleCod(@Valid UserPageReqVO pageReqVO) {
|
|
|
+ if(pageReqVO.getPageSize() == null){
|
|
|
+ pageReqVO.setPageSize(100);
|
|
|
+ }
|
|
|
+ // 获得用户分页列表
|
|
|
+ PageResult<AdminUserDO> pageResult = userService.getUserPageByRole(pageReqVO);
|
|
|
+ if (CollUtil.isEmpty(pageResult.getList())) {
|
|
|
+ return success(new PageResult<>(pageResult.getTotal()));
|
|
|
+ }
|
|
|
+ // 拼接数据
|
|
|
+ Map<String, DeptDO> deptMap = deptService.getDeptMap(
|
|
|
+ convertList(pageResult.getList(), AdminUserDO::getDeptId));
|
|
|
+ return success(new PageResult<>(UserConvert.INSTANCE.convertList(pageResult.getList(), deptMap),
|
|
|
+ pageResult.getTotal()));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|