From f5be9675a4f879ca0f0a873660fda5173d3a56a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Wed, 12 Apr 2023 10:20:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A1=E6=A0=B8=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E8=A7=92=E8=89=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/auth/AuthAdminController.java | 22 +++++++++++++++++++ .../auth/impl/AuthRoleServiceImpl.java | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/controller/auth/AuthAdminController.java b/src/main/java/com/glxp/api/controller/auth/AuthAdminController.java index 05e8769d..63924439 100644 --- a/src/main/java/com/glxp/api/controller/auth/AuthAdminController.java +++ b/src/main/java/com/glxp/api/controller/auth/AuthAdminController.java @@ -169,6 +169,28 @@ public class AuthAdminController { } + @AuthRuleAnnotation("admin/auth/admin/customerRoles") + @GetMapping("/admin/auth/admin/customerRolesList") + public BaseResponse customerRolesList(@RequestParam(value = "page", defaultValue = "1") Integer page, + @RequestParam(value = "limit", defaultValue = "100") Integer limit) { + + List authRoleList = authRoleService.listCustomerRoles(page, limit, 1); +// List authRoleList = authRoleService.listAuthRoles2(page, limit); + PageInfo pageInfo = new PageInfo<>(authRoleList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + List authAdminRoleResponses = authRoleList.stream().map(e -> { + AuthAdminRoleResponse authAdminRoleResponse = new AuthAdminRoleResponse(); + BeanUtils.copyProperties(e, authAdminRoleResponse); + return authAdminRoleResponse; + }).collect(Collectors.toList()); + pageSimpleResponse.setList(authAdminRoleResponses); + + return ResultVOUtils.success(pageSimpleResponse); + } + + + /** * 新增 * diff --git a/src/main/java/com/glxp/api/service/auth/impl/AuthRoleServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/AuthRoleServiceImpl.java index 8b5f8411..251b0fb4 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/AuthRoleServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/AuthRoleServiceImpl.java @@ -99,7 +99,7 @@ public class AuthRoleServiceImpl implements AuthRoleService { limit = limit != null && limit > 0 && limit < 100 ? limit : 100; int offset = (page - 1) * limit; PageHelper.offsetPage(offset, limit); - List list = authRoleDao.getCustomerRoles(isCustomer); + List list = authRoleDao.listCustomerRoles(isCustomer); return list; }