Commit 67e1879a8fb305d6a26ee2b73147a2ffb2b8f743
1 parent
837345ed
system:将 biz 的方法名的负数都换成 List
Showing
13 changed files
with
16 additions
and
16 deletions
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApiImpl.java
| @@ -19,7 +19,7 @@ public class TenantApiImpl implements TenantApi { | @@ -19,7 +19,7 @@ public class TenantApiImpl implements TenantApi { | ||
| 19 | 19 | ||
| 20 | @Override | 20 | @Override |
| 21 | public List<Long> getTenantIdList() { | 21 | public List<Long> getTenantIdList() { |
| 22 | - return tenantService.getTenantIds(); | 22 | + return tenantService.getTenantIdList(); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | @Override | 25 | @Override |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java
| @@ -108,7 +108,7 @@ public class AuthController { | @@ -108,7 +108,7 @@ public class AuthController { | ||
| 108 | 108 | ||
| 109 | @GetMapping("/list-menus") | 109 | @GetMapping("/list-menus") |
| 110 | @ApiOperation("获得登录用户的菜单列表") | 110 | @ApiOperation("获得登录用户的菜单列表") |
| 111 | - public CommonResult<List<AuthMenuRespVO>> getMenus() { | 111 | + public CommonResult<List<AuthMenuRespVO>> getMenuList() { |
| 112 | // 获得角色列表 | 112 | // 获得角色列表 |
| 113 | Set<Long> roleIds = permissionService.getUserRoleIdsFromCache(getLoginUserId(), singleton(CommonStatusEnum.ENABLE.getStatus())); | 113 | Set<Long> roleIds = permissionService.getUserRoleIdsFromCache(getLoginUserId(), singleton(CommonStatusEnum.ENABLE.getStatus())); |
| 114 | // 获得用户拥有的菜单列表 | 114 | // 获得用户拥有的菜单列表 |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java
| @@ -57,7 +57,7 @@ public class DeptController { | @@ -57,7 +57,7 @@ public class DeptController { | ||
| 57 | @GetMapping("/list") | 57 | @GetMapping("/list") |
| 58 | @ApiOperation("获取部门列表") | 58 | @ApiOperation("获取部门列表") |
| 59 | @PreAuthorize("@ss.hasPermission('system:dept:query')") | 59 | @PreAuthorize("@ss.hasPermission('system:dept:query')") |
| 60 | - public CommonResult<List<DeptRespVO>> listDepts(DeptListReqVO reqVO) { | 60 | + public CommonResult<List<DeptRespVO>> getDeptList(DeptListReqVO reqVO) { |
| 61 | List<DeptDO> list = deptService.getDeptList(reqVO); | 61 | List<DeptDO> list = deptService.getDeptList(reqVO); |
| 62 | list.sort(Comparator.comparing(DeptDO::getSort)); | 62 | list.sort(Comparator.comparing(DeptDO::getSort)); |
| 63 | return success(DeptConvert.INSTANCE.convertList(list)); | 63 | return success(DeptConvert.INSTANCE.convertList(list)); |
| @@ -65,7 +65,7 @@ public class DeptController { | @@ -65,7 +65,7 @@ public class DeptController { | ||
| 65 | 65 | ||
| 66 | @GetMapping("/list-all-simple") | 66 | @GetMapping("/list-all-simple") |
| 67 | @ApiOperation(value = "获取部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项") | 67 | @ApiOperation(value = "获取部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项") |
| 68 | - public CommonResult<List<DeptSimpleRespVO>> getSimpleDepts() { | 68 | + public CommonResult<List<DeptSimpleRespVO>> getSimpleDeptList() { |
| 69 | // 获得部门列表,只要开启状态的 | 69 | // 获得部门列表,只要开启状态的 |
| 70 | DeptListReqVO reqVO = new DeptListReqVO(); | 70 | DeptListReqVO reqVO = new DeptListReqVO(); |
| 71 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); | 71 | reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java
| @@ -70,7 +70,7 @@ public class PostController { | @@ -70,7 +70,7 @@ public class PostController { | ||
| 70 | 70 | ||
| 71 | @GetMapping("/list-all-simple") | 71 | @GetMapping("/list-all-simple") |
| 72 | @ApiOperation(value = "获取岗位精简信息列表", notes = "只包含被开启的岗位,主要用于前端的下拉选项") | 72 | @ApiOperation(value = "获取岗位精简信息列表", notes = "只包含被开启的岗位,主要用于前端的下拉选项") |
| 73 | - public CommonResult<List<PostSimpleRespVO>> getSimplePosts() { | 73 | + public CommonResult<List<PostSimpleRespVO>> getSimplePostList() { |
| 74 | // 获得岗位列表,只要开启状态的 | 74 | // 获得岗位列表,只要开启状态的 |
| 75 | List<PostDO> list = postService.getPostList(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); | 75 | List<PostDO> list = postService.getPostList(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); |
| 76 | // 排序后,返回给前端 | 76 | // 排序后,返回给前端 |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java
| @@ -61,7 +61,7 @@ public class DictDataController { | @@ -61,7 +61,7 @@ public class DictDataController { | ||
| 61 | @GetMapping("/list-all-simple") | 61 | @GetMapping("/list-all-simple") |
| 62 | @ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地") | 62 | @ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地") |
| 63 | // 无需添加权限认证,因为前端全局都需要 | 63 | // 无需添加权限认证,因为前端全局都需要 |
| 64 | - public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDatas() { | 64 | + public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDataList() { |
| 65 | List<DictDataDO> list = dictDataService.getDictDataList(); | 65 | List<DictDataDO> list = dictDataService.getDictDataList(); |
| 66 | return success(DictDataConvert.INSTANCE.convertList(list)); | 66 | return success(DictDataConvert.INSTANCE.convertList(list)); |
| 67 | } | 67 | } |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictTypeController.java
| @@ -76,7 +76,7 @@ public class DictTypeController { | @@ -76,7 +76,7 @@ public class DictTypeController { | ||
| 76 | @GetMapping("/list-all-simple") | 76 | @GetMapping("/list-all-simple") |
| 77 | @ApiOperation(value = "获得全部字典类型列表", notes = "包括开启 + 禁用的字典类型,主要用于前端的下拉选项") | 77 | @ApiOperation(value = "获得全部字典类型列表", notes = "包括开启 + 禁用的字典类型,主要用于前端的下拉选项") |
| 78 | // 无需添加权限认证,因为前端全局都需要 | 78 | // 无需添加权限认证,因为前端全局都需要 |
| 79 | - public CommonResult<List<DictTypeSimpleRespVO>> listSimpleDictTypes() { | 79 | + public CommonResult<List<DictTypeSimpleRespVO>> getSimpleDictTypeList() { |
| 80 | List<DictTypeDO> list = dictTypeService.getDictTypeList(); | 80 | List<DictTypeDO> list = dictTypeService.getDictTypeList(); |
| 81 | return success(DictTypeConvert.INSTANCE.convertList(list)); | 81 | return success(DictTypeConvert.INSTANCE.convertList(list)); |
| 82 | } | 82 | } |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/SensitiveWordController.java
| @@ -90,8 +90,8 @@ public class SensitiveWordController { | @@ -90,8 +90,8 @@ public class SensitiveWordController { | ||
| 90 | @GetMapping("/get-tags") | 90 | @GetMapping("/get-tags") |
| 91 | @ApiOperation("获取所有敏感词的标签数组") | 91 | @ApiOperation("获取所有敏感词的标签数组") |
| 92 | @PreAuthorize("@ss.hasPermission('system:sensitive-word:query')") | 92 | @PreAuthorize("@ss.hasPermission('system:sensitive-word:query')") |
| 93 | - public CommonResult<Set<String>> getSensitiveWordTags() throws IOException { | ||
| 94 | - return success(sensitiveWordService.getSensitiveWordTags()); | 93 | + public CommonResult<Set<String>> getSensitiveWordTagSet() { |
| 94 | + return success(sensitiveWordService.getSensitiveWordTagSet()); | ||
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | @GetMapping("/validate-text") | 97 | @GetMapping("/validate-text") |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordService.java
| @@ -81,7 +81,7 @@ public interface SensitiveWordService { | @@ -81,7 +81,7 @@ public interface SensitiveWordService { | ||
| 81 | * | 81 | * |
| 82 | * @return 标签数组 | 82 | * @return 标签数组 |
| 83 | */ | 83 | */ |
| 84 | - Set<String> getSensitiveWordTags(); | 84 | + Set<String> getSensitiveWordTagSet(); |
| 85 | 85 | ||
| 86 | /** | 86 | /** |
| 87 | * 获得文本所包含的不合法的敏感词数组 | 87 | * 获得文本所包含的不合法的敏感词数组 |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImpl.java
| @@ -182,7 +182,7 @@ public class SensitiveWordServiceImpl implements SensitiveWordService { | @@ -182,7 +182,7 @@ public class SensitiveWordServiceImpl implements SensitiveWordService { | ||
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | @Override | 184 | @Override |
| 185 | - public Set<String> getSensitiveWordTags() { | 185 | + public Set<String> getSensitiveWordTagSet() { |
| 186 | return sensitiveWordTagsCache; | 186 | return sensitiveWordTagsCache; |
| 187 | } | 187 | } |
| 188 | 188 |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java
| @@ -75,7 +75,7 @@ public class TenantServiceImpl implements TenantService { | @@ -75,7 +75,7 @@ public class TenantServiceImpl implements TenantService { | ||
| 75 | private PermissionService permissionService; | 75 | private PermissionService permissionService; |
| 76 | 76 | ||
| 77 | @Override | 77 | @Override |
| 78 | - public List<Long> getTenantIds() { | 78 | + public List<Long> getTenantIdList() { |
| 79 | List<TenantDO> tenants = tenantMapper.selectList(); | 79 | List<TenantDO> tenants = tenantMapper.selectList(); |
| 80 | return CollectionUtils.convertList(tenants, TenantDO::getId); | 80 | return CollectionUtils.convertList(tenants, TenantDO::getId); |
| 81 | } | 81 | } |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImplTest.java
| @@ -60,7 +60,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { | @@ -60,7 +60,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { | ||
| 60 | // 调用 | 60 | // 调用 |
| 61 | sensitiveWordService.initLocalCache(); | 61 | sensitiveWordService.initLocalCache(); |
| 62 | // 断言 sensitiveWordTagsCache 缓存 | 62 | // 断言 sensitiveWordTagsCache 缓存 |
| 63 | - assertEquals(SetUtils.asSet("论坛", "蔬菜"), sensitiveWordService.getSensitiveWordTags()); | 63 | + assertEquals(SetUtils.asSet("论坛", "蔬菜"), sensitiveWordService.getSensitiveWordTagSet()); |
| 64 | // 断言 tagSensitiveWordTries 缓存 | 64 | // 断言 tagSensitiveWordTries 缓存 |
| 65 | assertNotNull(sensitiveWordService.getDefaultSensitiveWordTrie()); | 65 | assertNotNull(sensitiveWordService.getDefaultSensitiveWordTrie()); |
| 66 | assertEquals(2, sensitiveWordService.getTagSensitiveWordTries().size()); | 66 | assertEquals(2, sensitiveWordService.getTagSensitiveWordTries().size()); |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java
| @@ -81,13 +81,13 @@ public class TenantServiceImplTest extends BaseDbUnitTest { | @@ -81,13 +81,13 @@ public class TenantServiceImplTest extends BaseDbUnitTest { | ||
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | @Test | 83 | @Test |
| 84 | - public void testGetTenantIds() { | 84 | + public void testGetTenantIdList() { |
| 85 | // mock 数据 | 85 | // mock 数据 |
| 86 | TenantDO tenant = randomPojo(TenantDO.class, o -> o.setId(1L)); | 86 | TenantDO tenant = randomPojo(TenantDO.class, o -> o.setId(1L)); |
| 87 | tenantMapper.insert(tenant); | 87 | tenantMapper.insert(tenant); |
| 88 | 88 | ||
| 89 | // 调用,并断言业务异常 | 89 | // 调用,并断言业务异常 |
| 90 | - List<Long> result = tenantService.getTenantIds(); | 90 | + List<Long> result = tenantService.getTenantIdList(); |
| 91 | assertEquals(Collections.singletonList(1L), result); | 91 | assertEquals(Collections.singletonList(1L), result); |
| 92 | } | 92 | } |
| 93 | 93 |