Skip to content

Commit

Permalink
Merge pull request #419 from caofengbin/feature/supportPaging
Browse files Browse the repository at this point in the history
fix:后台管理中心,权限配置的三个tab,不支持前端的分页参数请求,bug fix
  • Loading branch information
ZhouYixun authored Feb 4, 2024
2 parents 9560e2c + 3bb05e7 commit f79b434
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ public class ResourcesController {
@Operation(summary = "查询所有资源连接", description = "查询所有资源连接")
@GetMapping("/list")
@Parameters(value = {
@Parameter(name = "page", description = "页码")
@Parameter(name = "page", description = "页码"),
@Parameter(name = "pageSize", description = "每页请求数量")
})
public RespModel<CommentPage<ResourcesDTO>> listResources(@RequestParam(name = "page") int page,
@RequestParam(name = "pageSize") int pageSize,
@RequestParam(name = "path", required = false) String path) {
Page<Resources> pageable = new Page<>(page, 20);
Page<Resources> pageable = new Page<>(page, pageSize);

return RespModel.result(RespEnum.SEARCH_OK, resourcesService.listResource(pageable, path, false));
}
Expand All @@ -48,7 +50,7 @@ public RespModel<CommentPage<ResourcesDTO>> listResources(@RequestParam(name = "
@PostMapping("/refresh")
public RespModel<CommentPage<ResourcesDTO>> refreshResources() {
resourcesService.init();
return listResources(1, null);
return listResources(1, 20, null);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ public class RolesController {
@GetMapping("/list")
@Parameters(value = {
@Parameter(name = "page", description = "页码"),
@Parameter(name = "pageSize", description = "每页请求数量"),
@Parameter(name = "isAll", description = "是否全部"),
@Parameter(name = "roleName", description = "角色名称"),

})
public RespModel<CommentPage<RolesDTO>> listResources(@RequestParam(name = "page") int page,
@RequestParam(name = "pageSize", required = false, defaultValue = "20") int pageSize,
@RequestParam(name = "isAll", required = false) boolean isAll,
@RequestParam(name = "roleName", required = false) String roleName) {
Page<Roles> pageable = new Page<>(page, 20);
Page<Roles> pageable = new Page<>(page, pageSize);
if (isAll) {
pageable.setSize(1000L);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,14 @@ public RespModel<String> changePwd(HttpServletRequest request, @Validated @Reque
@GetMapping("/list")
@Parameters(value = {
@Parameter(name = "page", description = "页码"),
@Parameter(name = "pageSize", description = "每页请求数量"),
@Parameter(name = "userName", description = "角色名称"),

})
public RespModel<CommentPage<UsersDTO>> listResources(@RequestParam(name = "page") int page
, @RequestParam(name = "userName", required = false) String userName) {
Page<Users> pageable = new Page<>(page, 20);
public RespModel<CommentPage<UsersDTO>> listResources(@RequestParam(name = "page") int page,
@RequestParam(name = "pageSize", required = false, defaultValue = "20") int pageSize,
@RequestParam(name = "userName", required = false) String userName) {
Page<Users> pageable = new Page<>(page, pageSize);

return RespModel.result(RespEnum.SEARCH_OK, usersService.listUsers(pageable, userName));
}
Expand Down

0 comments on commit f79b434

Please sign in to comment.