diff --git a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/ResourcesController.java b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/ResourcesController.java index 1ad88794..69b2e2b8 100644 --- a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/ResourcesController.java +++ b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/ResourcesController.java @@ -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> listResources(@RequestParam(name = "page") int page, + @RequestParam(name = "pageSize") int pageSize, @RequestParam(name = "path", required = false) String path) { - Page pageable = new Page<>(page, 20); + Page pageable = new Page<>(page, pageSize); return RespModel.result(RespEnum.SEARCH_OK, resourcesService.listResource(pageable, path, false)); } @@ -48,7 +50,7 @@ public RespModel> listResources(@RequestParam(name = " @PostMapping("/refresh") public RespModel> refreshResources() { resourcesService.init(); - return listResources(1, null); + return listResources(1, 20, null); } diff --git a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/RolesController.java b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/RolesController.java index 6f8adff8..67b52ccf 100644 --- a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/RolesController.java +++ b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/RolesController.java @@ -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> 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 pageable = new Page<>(page, 20); + Page pageable = new Page<>(page, pageSize); if (isAll) { pageable.setSize(1000L); } diff --git a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/UsersController.java b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/UsersController.java index 3b41acc2..fe5cb4c8 100644 --- a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/UsersController.java +++ b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/controller/UsersController.java @@ -143,12 +143,14 @@ public RespModel changePwd(HttpServletRequest request, @Validated @Reque @GetMapping("/list") @Parameters(value = { @Parameter(name = "page", description = "页码"), + @Parameter(name = "pageSize", description = "每页请求数量"), @Parameter(name = "userName", description = "角色名称"), }) - public RespModel> listResources(@RequestParam(name = "page") int page - , @RequestParam(name = "userName", required = false) String userName) { - Page pageable = new Page<>(page, 20); + public RespModel> listResources(@RequestParam(name = "page") int page, + @RequestParam(name = "pageSize", required = false, defaultValue = "20") int pageSize, + @RequestParam(name = "userName", required = false) String userName) { + Page pageable = new Page<>(page, pageSize); return RespModel.result(RespEnum.SEARCH_OK, usersService.listUsers(pageable, userName)); }