diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/core/service/impl/UserDetailsServiceImpl.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/core/service/impl/UserDetailsServiceImpl.java index fd40aaaa..2b854ca9 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/core/service/impl/UserDetailsServiceImpl.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/core/service/impl/UserDetailsServiceImpl.java @@ -35,7 +35,7 @@ public class UserDetailsServiceImpl implements UserDetailsService { throw new BadRequestException("账号未激活!"); } // 获取用户的权限 - List authorities = roleService.buildPermissions(user); + List authorities = roleService.buildUserRolePermissions(user); // 初始化JwtUserDto userJwtModel = new UserJwtModel(user, dataService.describeDeptIdListByUserIdWithDeptId(user), authorities); // 添加缓存数据 diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/MenuController.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/MenuController.java index d18c0e64..b354bac7 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/MenuController.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/MenuController.java @@ -44,22 +44,22 @@ public class MenuController { @GetMapping(value = "/download") @PreAuthorize("@el.check('menu:list')") public void exportMenu(HttpServletResponse response, QueryMenuRequest criteria) throws Exception { - menuService.downloadExcel(menuService.selectMenuByCriteria(criteria, false), response); + menuService.downloadMenuExcel(menuService.describeMenuList(criteria, false), response); } @PostMapping(value = "/buildMenus") @ApiOperation("获取前端所需菜单") public ResponseEntity> buildMenus() { - List menuList = menuService.selectMenuByUserId(SecurityHelper.getCurrentUserId()); - List menus = menuService.buildTree(menuList); - return new ResponseEntity<>(menuService.buildMenus(menus), HttpStatus.OK); + List menuList = menuService.describeMenuListByUserId(SecurityHelper.getCurrentUserId()); + List menus = menuService.buildMenuTree(menuList); + return new ResponseEntity<>(menuService.buildMenuResponse(menus), HttpStatus.OK); } @ApiOperation("返回全部的菜单") @PostMapping(value = "/queryAllMenu") @PreAuthorize("@el.check('menu:list','roles:list')") public ResponseEntity> queryAllMenu(@RequestParam Long pid) { - return new ResponseEntity<>(menuService.selectMenuByPid(pid), HttpStatus.OK); + return new ResponseEntity<>(menuService.describeMenuListByPid(pid), HttpStatus.OK); } @ApiOperation("根据菜单ID返回所有子节点ID,包含自身ID") @@ -67,9 +67,9 @@ public class MenuController { @PreAuthorize("@el.check('menu:list','roles:list')") public ResponseEntity queryChildMenu(@RequestParam Long id) { Set menuSet = new HashSet<>(); - List menuList = menuService.selectMenuByPid(id); + List menuList = menuService.describeMenuListByPid(id); menuSet.add(menuService.getById(id)); - menuSet = menuService.selectChildMenus(menuList, menuSet); + menuSet = menuService.describeChildMenuSet(menuList, menuSet); Set ids = menuSet.stream().map(Menu::getId).collect(Collectors.toSet()); return new ResponseEntity<>(ids, HttpStatus.OK); } @@ -78,7 +78,7 @@ public class MenuController { @ApiOperation("查询菜单") @PreAuthorize("@el.check('menu:list')") public ResponseEntity> queryMenu(QueryMenuRequest criteria) throws Exception { - List menuList = menuService.selectMenuByCriteria(criteria, true); + List menuList = menuService.describeMenuList(criteria, true); return new ResponseEntity<>(PageUtil.toPage(menuList), HttpStatus.OK); } @@ -89,8 +89,8 @@ public class MenuController { Set menus = new LinkedHashSet<>(); if (CollectionUtil.isNotEmpty(ids)) { for (Long id : ids) { - Menu menu = menuService.getMenuById(id); - List menuList = menuService.selectSuperiorMenu(menu, new ArrayList<>()); + Menu menu = menuService.describeMenuById(id); + List menuList = menuService.describeSuperiorMenuList(menu, new ArrayList<>()); for (Menu data : menuList) { if (data.getId().equals(menu.getPid())) { data.setSubCount(data.getSubCount() - 1); @@ -100,9 +100,9 @@ public class MenuController { } // 编辑菜单时不显示自己以及自己下级的数据,避免出现PID数据环形问题 menus = menus.stream().filter(i -> !ids.contains(i.getId())).collect(Collectors.toSet()); - return new ResponseEntity<>(menuService.buildTree(new ArrayList<>(menus)), HttpStatus.OK); + return new ResponseEntity<>(menuService.buildMenuTree(new ArrayList<>(menus)), HttpStatus.OK); } - return new ResponseEntity<>(menuService.selectMenuByPid(null), HttpStatus.OK); + return new ResponseEntity<>(menuService.describeMenuListByPid(null), HttpStatus.OK); } @ApiOperation("新增菜单") @@ -112,7 +112,7 @@ public class MenuController { if (resources.getId() != null) { throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID"); } - menuService.saveMenu(resources); + menuService.createMenu(resources); return new ResponseEntity<>(HttpStatus.CREATED); } @@ -120,7 +120,7 @@ public class MenuController { @PostMapping(value = "/updateMenu") @PreAuthorize("@el.check('menu:edit')") public ResponseEntity updateMenu(@Validated(Menu.Update.class) @RequestBody Menu resources) { - menuService.updateMenuById(resources); + menuService.modifyMenuById(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -130,9 +130,9 @@ public class MenuController { public ResponseEntity deleteMenu(@RequestBody Set ids) { Set menuSet = new HashSet<>(); for (Long id : ids) { - List menuList = menuService.selectMenuByPid(id); + List menuList = menuService.describeMenuListByPid(id); menuSet.add(menuService.getById(id)); - menuSet = menuService.selectChildMenus(menuList, menuSet); + menuSet = menuService.describeChildMenuSet(menuList, menuSet); } menuService.deleteMenuByIds(menuSet); return new ResponseEntity<>(HttpStatus.OK); diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/MonitorController.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/MonitorController.java index 54324900..58d6f135 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/MonitorController.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/MonitorController.java @@ -23,6 +23,6 @@ public class MonitorController { @ApiOperation("查询服务监控") @PreAuthorize("@el.check('monitor:list')") public ResponseEntity queryMonitor() { - return new ResponseEntity<>(serverService.getServerInfo(), HttpStatus.OK); + return new ResponseEntity<>(serverService.describeServerMonitorInfo(), HttpStatus.OK); } } diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/RoleController.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/RoleController.java index 16eef3fc..31c0184f 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/RoleController.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/RoleController.java @@ -41,21 +41,21 @@ public class RoleController { @PostMapping(value = "/getRoleById/{id}") @PreAuthorize("@el.check('roles:list')") public ResponseEntity getRoleById(@PathVariable Long id) { - return new ResponseEntity<>(roleService.getRoleById(id), HttpStatus.OK); + return new ResponseEntity<>(roleService.describeRoleById(id), HttpStatus.OK); } @ApiOperation("导出角色数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('role:list')") public void exportRole(HttpServletResponse response, QueryRoleRequest criteria) throws IOException { - roleService.downloadExcel(roleService.selectRoleByCriteria(criteria), response); + roleService.downloadRoleExcel(roleService.describeRoleList(criteria), response); } @ApiOperation("返回全部的角色") @PostMapping(value = "/queryAllRole") @PreAuthorize("@el.check('roles:list','user:add','user:edit')") public ResponseEntity> queryAllRole() { - return new ResponseEntity<>(roleService.selectRole(), HttpStatus.OK); + return new ResponseEntity<>(roleService.describeRoleList(), HttpStatus.OK); } @ApiOperation("查询角色") @@ -63,20 +63,20 @@ public class RoleController { @PreAuthorize("@el.check('roles:list')") public ResponseEntity> queryRole(QueryRoleRequest criteria) { Page page = new Page<>(criteria.getPage(), criteria.getSize()); - return new ResponseEntity<>(roleService.queryRolePage(criteria, page), HttpStatus.OK); + return new ResponseEntity<>(roleService.describeRolePage(criteria, page), HttpStatus.OK); } @ApiOperation("获取用户级别") @PostMapping(value = "/getRoleLevel") public ResponseEntity getRoleLevel() { - return new ResponseEntity<>(Dict.create().set("level", getLevels(null)), HttpStatus.OK); + return new ResponseEntity<>(Dict.create().set("level", checkRoleLevels(null)), HttpStatus.OK); } @ApiOperation("新增角色") @PostMapping(value = "/createRole") @PreAuthorize("@el.check('roles:add')") public ResponseEntity createRole(@Validated @RequestBody CreateRoleRequest resources) { - getLevels(resources.getLevel()); + checkRoleLevels(resources.getLevel()); roleService.createRole(resources); return new ResponseEntity<>(HttpStatus.CREATED); } @@ -85,8 +85,8 @@ public class RoleController { @PostMapping(value = "/updateRole") @PreAuthorize("@el.check('roles:edit')") public ResponseEntity updateRole(@Validated(Role.Update.class) @RequestBody Role resources) { - getLevels(resources.getLevel()); - roleService.updateRoleById(resources); + checkRoleLevels(resources.getLevel()); + roleService.modifyRoleById(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -95,8 +95,8 @@ public class RoleController { @PreAuthorize("@el.check('roles:edit')") public ResponseEntity updateRoleMenu(@RequestBody Role resources) { Role role = roleService.getById(resources.getId()); - getLevels(role.getLevel()); - roleService.updateMenuById(resources); + checkRoleLevels(role.getLevel()); + roleService.modifyBindMenuById(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -106,7 +106,7 @@ public class RoleController { public ResponseEntity deleteRole(@RequestBody Set ids) { for (Long id : ids) { Role role = roleService.getById(id); - getLevels(role.getLevel()); + checkRoleLevels(role.getLevel()); } // 验证是否被用户关联 roleService.verifyBindRelationByIds(ids); @@ -115,12 +115,12 @@ public class RoleController { } /** - * 获取用户的角色级别 + * 检查用户的角色级别 * * @return / */ - private int getLevels(Integer level) { - List levels = roleService.selectRoleByUsersId(SecurityHelper.getCurrentUserId()).stream().map(Role::getLevel).collect(Collectors.toList()); + private int checkRoleLevels(Integer level) { + List levels = roleService.describeRoleListByUsersId(SecurityHelper.getCurrentUserId()).stream().map(Role::getLevel).collect(Collectors.toList()); int min = Collections.min(levels); if (level != null) { if (level < min) { diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/UserController.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/UserController.java index 31d94692..bfff87bd 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/UserController.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/rest/UserController.java @@ -131,8 +131,8 @@ public class UserController { @PreAuthorize("@el.check('user:del')") public ResponseEntity deleteUser(@RequestBody Set ids) { for (Long id : ids) { - Integer currentLevel = Collections.min(roleService.selectRoleByUsersId(SecurityHelper.getCurrentUserId()).stream().map(Role::getLevel).collect(Collectors.toList())); - Integer optLevel = Collections.min(roleService.selectRoleByUsersId(id).stream().map(Role::getLevel).collect(Collectors.toList())); + Integer currentLevel = Collections.min(roleService.describeRoleListByUsersId(SecurityHelper.getCurrentUserId()).stream().map(Role::getLevel).collect(Collectors.toList())); + Integer optLevel = Collections.min(roleService.describeRoleListByUsersId(id).stream().map(Role::getLevel).collect(Collectors.toList())); if (currentLevel > optLevel) { throw new BadRequestException("角色权限不足,不能删除:" + userService.getUserById(id).getUsername()); } @@ -190,8 +190,8 @@ public class UserController { * @param resources / */ private void checkLevel(User resources) { - Integer currentLevel = Collections.min(roleService.selectRoleByUsersId(SecurityHelper.getCurrentUserId()).stream().map(Role::getLevel).collect(Collectors.toList())); - Integer optLevel = roleService.getDeptLevelByRoles(resources.getRoles()); + Integer currentLevel = Collections.min(roleService.describeRoleListByUsersId(SecurityHelper.getCurrentUserId()).stream().map(Role::getLevel).collect(Collectors.toList())); + Integer optLevel = roleService.describeDeptLevelByRoles(resources.getRoles()); if (currentLevel > optLevel) { throw new BadRequestException("角色权限不足"); } diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/MenuService.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/MenuService.java index 79bb8d37..ee1a1bd5 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/MenuService.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/MenuService.java @@ -19,7 +19,7 @@ public interface MenuService extends IService { * @return / * @throws Exception / */ - List selectMenuByCriteria(QueryMenuRequest criteria, Boolean isQuery) throws Exception; + List describeMenuList(QueryMenuRequest criteria, Boolean isQuery) throws Exception; /** * 根据ID查询 @@ -27,21 +27,21 @@ public interface MenuService extends IService { * @param id / * @return / */ - Menu getMenuById(long id); + Menu describeMenuById(long id); /** * 创建 * * @param resources / */ - void saveMenu(Menu resources); + void createMenu(Menu resources); /** * 编辑 * * @param resources / */ - void updateMenuById(Menu resources); + void modifyMenuById(Menu resources); /** * 获取所有子节点,包含自身ID @@ -50,7 +50,7 @@ public interface MenuService extends IService { * @param menuSet / * @return / */ - Set selectChildMenus(List menuList, Set menuSet); + Set describeChildMenuSet(List menuList, Set menuSet); /** * 构建菜单树 @@ -58,7 +58,7 @@ public interface MenuService extends IService { * @param menus 原始数据 * @return / */ - List buildTree(List menus); + List buildMenuTree(List menus); /** * 构建菜单树 @@ -66,7 +66,7 @@ public interface MenuService extends IService { * @param menus / * @return / */ - List buildMenus(List menus); + List buildMenuResponse(List menus); /** * 删除 @@ -82,7 +82,7 @@ public interface MenuService extends IService { * @param response / * @throws IOException / */ - void downloadExcel(List menus, HttpServletResponse response) throws IOException; + void downloadMenuExcel(List menus, HttpServletResponse response) throws IOException; /** * 懒加载菜单数据 @@ -90,7 +90,7 @@ public interface MenuService extends IService { * @param pid / * @return / */ - List selectMenuByPid(Long pid); + List describeMenuListByPid(Long pid); /** * 根据ID获取同级与上级数据 @@ -99,7 +99,7 @@ public interface MenuService extends IService { * @param objects / * @return / */ - List selectSuperiorMenu(Menu menu, List objects); + List describeSuperiorMenuList(Menu menu, List objects); /** * 根据当前用户获取菜单 @@ -107,5 +107,5 @@ public interface MenuService extends IService { * @param currentUserId / * @return / */ - List selectMenuByUserId(Long currentUserId); + List describeMenuListByUserId(Long currentUserId); } diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/MonitorService.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/MonitorService.java index 3007f7db..3b67d05e 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/MonitorService.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/MonitorService.java @@ -5,9 +5,9 @@ import java.util.Map; public interface MonitorService { /** - * 查询数据分页 + * 查询服务器监控信息 * * @return Map */ - Map getServerInfo(); + Map describeServerMonitorInfo(); } diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/RoleService.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/RoleService.java index 7aa3c99c..926ab789 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/RoleService.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/RoleService.java @@ -21,7 +21,7 @@ public interface RoleService extends IService { * * @return / */ - List selectRole(); + List describeRoleList(); /** * 查询全部 @@ -29,7 +29,7 @@ public interface RoleService extends IService { * @param criteria 条件 * @return / */ - List selectRoleByCriteria(QueryRoleRequest criteria); + List describeRoleList(QueryRoleRequest criteria); /** * 待条件分页查询 @@ -38,7 +38,7 @@ public interface RoleService extends IService { * @param page 分页参数 * @return / */ - PageResult queryRolePage(QueryRoleRequest criteria, Page page); + PageResult describeRolePage(QueryRoleRequest criteria, Page page); /** * 根据ID查询 @@ -46,7 +46,7 @@ public interface RoleService extends IService { * @param id / * @return / */ - Role getRoleById(long id); + Role describeRoleById(long id); /** * 创建 @@ -60,14 +60,14 @@ public interface RoleService extends IService { * * @param resources / */ - void updateRoleById(Role resources); + void modifyRoleById(Role resources); /** * 修改绑定的菜单 * * @param resources / */ - void updateMenuById(Role resources); + void modifyBindMenuById(Role resources); /** * 删除 @@ -82,7 +82,7 @@ public interface RoleService extends IService { * @param userId 用户ID * @return / */ - List selectRoleByUsersId(Long userId); + List describeRoleListByUsersId(Long userId); /** * 根据角色查询角色级别 @@ -90,7 +90,7 @@ public interface RoleService extends IService { * @param roles / * @return / */ - Integer getDeptLevelByRoles(Set roles); + Integer describeDeptLevelByRoles(Set roles); /** * 获取用户权限信息 @@ -98,7 +98,7 @@ public interface RoleService extends IService { * @param user 用户信息 * @return 权限信息 */ - List buildPermissions(User user); + List buildUserRolePermissions(User user); /** * 导出数据 @@ -107,7 +107,7 @@ public interface RoleService extends IService { * @param response / * @throws IOException / */ - void downloadExcel(List roles, HttpServletResponse response) throws IOException; + void downloadRoleExcel(List roles, HttpServletResponse response) throws IOException; /** * 验证是否被用户关联 @@ -122,5 +122,5 @@ public interface RoleService extends IService { * @param menuId / * @return / */ - List selectRoleByMenuId(Long menuId); + List describeRoleListByMenuId(Long menuId); } diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/DataServiceImpl.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/DataServiceImpl.java index 7e69dc0c..521c7231 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/DataServiceImpl.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/DataServiceImpl.java @@ -42,7 +42,7 @@ public class DataServiceImpl implements DataService { if (CollUtil.isEmpty(ids)) { Set deptIds = new HashSet<>(); // 查询用户角色 - List roleList = roleService.selectRoleByUsersId(user.getId()); + List roleList = roleService.describeRoleListByUsersId(user.getId()); // 获取对应的部门ID for (Role role : roleList) { DataScopeEnum dataScopeEnum = DataScopeEnum.find(role.getDataScope()); diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MenuServiceImpl.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MenuServiceImpl.java index 21e81cc0..666bc7f8 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MenuServiceImpl.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MenuServiceImpl.java @@ -53,7 +53,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me private static final String NO_STR = "否"; @Override - public List selectMenuByCriteria(QueryMenuRequest criteria, Boolean isQuery) throws Exception { + public List describeMenuList(QueryMenuRequest criteria, Boolean isQuery) throws Exception { if (Boolean.TRUE.equals(isQuery)) { criteria.setPidIsNull(true); List fields = ClassUtil.getAllFields(criteria.getClass(), new ArrayList<>()); @@ -75,7 +75,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me } @Override - public Menu getMenuById(long id) { + public Menu describeMenuById(long id) { String key = SystemRedisKey.MENU_ID + id; Menu menu = redisHelper.get(key, Menu.class); if (menu == null) { @@ -92,11 +92,11 @@ public class MenuServiceImpl extends ServiceImpl implements Me * @return / */ @Override - public List selectMenuByUserId(Long currentUserId) { + public List describeMenuListByUserId(Long currentUserId) { String key = SystemRedisKey.MENU_USER + currentUserId; List menus = redisHelper.getList(key, Menu.class); if (CollUtil.isEmpty(menus)) { - List roles = roleService.selectRoleByUsersId(currentUserId); + List roles = roleService.describeRoleListByUsersId(currentUserId); Set roleIds = roles.stream().map(Role::getId).collect(Collectors.toSet()); menus = new ArrayList<>(menuMapper.queryMenuSetByRoleIdsAndType(roleIds, 2)); redisHelper.set(key, menus, 1, TimeUnit.DAYS); @@ -106,7 +106,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me @Override @Transactional(rollbackFor = Exception.class) - public void saveMenu(Menu resources) { + public void createMenu(Menu resources) { if (menuMapper.getMenuByTitle(resources.getTitle()) != null) { throw new EntityExistException(Menu.class, "title", resources.getTitle()); } @@ -132,7 +132,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me @Override @Transactional(rollbackFor = Exception.class) - public void updateMenuById(Menu resources) { + public void modifyMenuById(Menu resources) { if (resources.getId().equals(resources.getPid())) { throw new BadRequestException("上级不能为自己"); } @@ -183,12 +183,12 @@ public class MenuServiceImpl extends ServiceImpl implements Me } @Override - public Set selectChildMenus(List menuList, Set menuSet) { + public Set describeChildMenuSet(List menuList, Set menuSet) { for (Menu menu : menuList) { menuSet.add(menu); List menus = menuMapper.queryMenuListByPidOrderByMenuSort(menu.getId()); if (CollUtil.isNotEmpty(menus)) { - selectChildMenus(menus, menuSet); + describeChildMenuSet(menus, menuSet); } } return menuSet; @@ -207,7 +207,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me } @Override - public List selectMenuByPid(Long pid) { + public List describeMenuListByPid(Long pid) { List menus; if (pid != null && !pid.equals(0L)) { menus = menuMapper.queryMenuListByPidOrderByMenuSort(pid); @@ -218,17 +218,17 @@ public class MenuServiceImpl extends ServiceImpl implements Me } @Override - public List selectSuperiorMenu(Menu menu, List menus) { + public List describeSuperiorMenuList(Menu menu, List menus) { if (menu.getPid() == null) { menus.addAll(menuMapper.queryMenuListByPidIsNullOrderByMenuSort()); return menus; } menus.addAll(menuMapper.queryMenuListByPidOrderByMenuSort(menu.getPid())); - return selectSuperiorMenu(getMenuById(menu.getPid()), menus); + return describeSuperiorMenuList(describeMenuById(menu.getPid()), menus); } @Override - public List buildTree(List menus) { + public List buildMenuTree(List menus) { List trees = new ArrayList<>(); Set ids = new HashSet<>(); for (Menu menu : menus) { @@ -252,7 +252,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me } @Override - public List buildMenus(List menus) { + public List buildMenuResponse(List menus) { List list = new LinkedList<>(); menus.forEach(menu -> { if (menu != null) { @@ -277,7 +277,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me if (CollectionUtil.isNotEmpty(menuList)) { menuResponse.setAlwaysShow(true); menuResponse.setRedirect("noredirect"); - menuResponse.setChildren(buildMenus(menuList)); + menuResponse.setChildren(buildMenuResponse(menuList)); // 处理是一级菜单并且没有子菜单的情况 } else if (menu.getPid() == null) { MenuResponse menuResponse1 = getMenuVo(menu, menuResponse); @@ -296,7 +296,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me } @Override - public void downloadExcel(List menus, HttpServletResponse response) throws IOException { + public void downloadMenuExcel(List menus, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); for (Menu menu : menus) { Map map = new LinkedHashMap<>(); @@ -329,7 +329,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me redisHelper.del(SystemRedisKey.MENU_ID + id); redisHelper.delByKeys(SystemRedisKey.MENU_USER, users.stream().map(User::getId).collect(Collectors.toSet())); // 清除 Role 缓存 - List roles = roleService.selectRoleByMenuId(id); + List roles = roleService.describeRoleListByMenuId(id); redisHelper.delByKeys(SystemRedisKey.ROLE_ID, roles.stream().map(Role::getId).collect(Collectors.toSet())); } diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MonitorServiceImpl.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MonitorServiceImpl.java index 90d3ae90..e6705e22 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MonitorServiceImpl.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MonitorServiceImpl.java @@ -32,7 +32,7 @@ public class MonitorServiceImpl implements MonitorService { private final DecimalFormat df = new DecimalFormat("0.00"); @Override - public Map getServerInfo() { + public Map describeServerMonitorInfo() { Map resultMap = new LinkedHashMap<>(8); try { SystemInfo si = new SystemInfo(); diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/RoleServiceImpl.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/RoleServiceImpl.java index 55b5a1a9..3142488c 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/RoleServiceImpl.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/RoleServiceImpl.java @@ -51,17 +51,17 @@ public class RoleServiceImpl extends ServiceImpl implements Ro private final RedisHelper redisHelper; @Override - public List selectRole() { + public List describeRoleList() { return roleMapper.queryRoleList(); } @Override - public List selectRoleByCriteria(QueryRoleRequest criteria) { + public List describeRoleList(QueryRoleRequest criteria) { return roleMapper.queryRoleListByArgs(criteria); } @Override - public PageResult queryRolePage(QueryRoleRequest criteria, Page page) { + public PageResult describeRolePage(QueryRoleRequest criteria, Page page) { criteria.setOffset(page.offset()); List roles = roleMapper.queryRoleListByArgs(criteria); Long total = roleMapper.getRoleCountByArgs(criteria); @@ -69,7 +69,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro } @Override - public Role getRoleById(long id) { + public Role describeRoleById(long id) { String key = SystemRedisKey.ROLE_ID + id; Role role = redisHelper.get(key, Role.class); if (role == null) { @@ -94,7 +94,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro @Override @Transactional(rollbackFor = Exception.class) - public void updateRoleById(Role resources) { + public void modifyRoleById(Role resources) { Role role = getById(resources.getId()); Role role1 = roleMapper.getRoleByName(resources.getName()); if (role1 != null && !role1.getId().equals(role.getId())) { @@ -118,7 +118,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro } @Override - public void updateMenuById(Role role) { + public void modifyBindMenuById(Role role) { List users = userMapper.queryUserListByRoleId(role.getId()); // 更新菜单 roleMenuMapper.deleteByRoleId(role.getId()); @@ -144,7 +144,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro } @Override - public List selectRoleByUsersId(Long userId) { + public List describeRoleListByUsersId(Long userId) { String key = SystemRedisKey.ROLE_USER + userId; List roles = redisHelper.getList(key, Role.class); if (CollUtil.isEmpty(roles)) { @@ -155,19 +155,19 @@ public class RoleServiceImpl extends ServiceImpl implements Ro } @Override - public Integer getDeptLevelByRoles(Set roles) { + public Integer describeDeptLevelByRoles(Set roles) { if (CollUtil.isEmpty(roles)) { return Integer.MAX_VALUE; } Set roleSet = new HashSet<>(); for (Role role : roles) { - roleSet.add(getRoleById(role.getId())); + roleSet.add(describeRoleById(role.getId())); } return Collections.min(roleSet.stream().map(Role::getLevel).collect(Collectors.toList())); } @Override - public List buildPermissions(User user) { + public List buildUserRolePermissions(User user) { String key = SystemRedisKey.ROLE_AUTH + user.getId(); List authorityList = redisHelper.getList(key, RoleCodeModel.class); if (CollUtil.isEmpty(authorityList)) { @@ -190,7 +190,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro } @Override - public void downloadExcel(List roles, HttpServletResponse response) throws IOException { + public void downloadRoleExcel(List roles, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); for (Role role : roles) { Map map = new LinkedHashMap<>(); @@ -211,7 +211,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro } @Override - public List selectRoleByMenuId(Long menuId) { + public List describeRoleListByMenuId(Long menuId) { return roleMapper.queryRoleListByMenuId(menuId); }