system:将 biz 的方法名的负数都换成 List

This commit is contained in:
YunaiV 2023-02-04 00:26:53 +08:00
parent d5fe4a3c89
commit f6d259b620
13 changed files with 16 additions and 17 deletions

View File

@ -22,7 +22,7 @@ public class TenantApiImpl implements TenantApi {
@Override
public CommonResult<List<Long>> getTenantIdList() {
return success(tenantService.getTenantIds());
return success(tenantService.getTenantIdList());
}
@Override

View File

@ -109,7 +109,7 @@ public class AuthController {
@GetMapping("/list-menus")
@ApiOperation("获得登录用户的菜单列表")
public CommonResult<List<AuthMenuRespVO>> getMenus() {
public CommonResult<List<AuthMenuRespVO>> getMenuList() {
// 获得角色列表
Set<Long> roleIds = permissionService.getUserRoleIdsFromCache(getLoginUserId(), singleton(CommonStatusEnum.ENABLE.getStatus()));
// 获得用户拥有的菜单列表

View File

@ -57,7 +57,7 @@ public class DeptController {
@GetMapping("/list")
@ApiOperation("获取部门列表")
@PreAuthorize("@ss.hasPermission('system:dept:query')")
public CommonResult<List<DeptRespVO>> listDepts(DeptListReqVO reqVO) {
public CommonResult<List<DeptRespVO>> getDeptList(DeptListReqVO reqVO) {
List<DeptDO> list = deptService.getDeptList(reqVO);
list.sort(Comparator.comparing(DeptDO::getSort));
return success(DeptConvert.INSTANCE.convertList(list));
@ -65,7 +65,7 @@ public class DeptController {
@GetMapping("/list-all-simple")
@ApiOperation(value = "获取部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项")
public CommonResult<List<DeptSimpleRespVO>> getSimpleDepts() {
public CommonResult<List<DeptSimpleRespVO>> getSimpleDeptList() {
// 获得部门列表只要开启状态的
DeptListReqVO reqVO = new DeptListReqVO();
reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());

View File

@ -70,7 +70,7 @@ public class PostController {
@GetMapping("/list-all-simple")
@ApiOperation(value = "获取岗位精简信息列表", notes = "只包含被开启的岗位,主要用于前端的下拉选项")
public CommonResult<List<PostSimpleRespVO>> getSimplePosts() {
public CommonResult<List<PostSimpleRespVO>> getSimplePostList() {
// 获得岗位列表只要开启状态的
List<PostDO> list = postService.getPostList(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus()));
// 排序后返回给前端

View File

@ -61,7 +61,7 @@ public class DictDataController {
@GetMapping("/list-all-simple")
@ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地")
// 无需添加权限认证因为前端全局都需要
public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDatas() {
public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDataList() {
List<DictDataDO> list = dictDataService.getDictDataList();
return success(DictDataConvert.INSTANCE.convertList(list));
}

View File

@ -76,7 +76,7 @@ public class DictTypeController {
@GetMapping("/list-all-simple")
@ApiOperation(value = "获得全部字典类型列表", notes = "包括开启 + 禁用的字典类型,主要用于前端的下拉选项")
// 无需添加权限认证因为前端全局都需要
public CommonResult<List<DictTypeSimpleRespVO>> listSimpleDictTypes() {
public CommonResult<List<DictTypeSimpleRespVO>> getSimpleDictTypeList() {
List<DictTypeDO> list = dictTypeService.getDictTypeList();
return success(DictTypeConvert.INSTANCE.convertList(list));
}

View File

@ -90,8 +90,8 @@ public class SensitiveWordController {
@GetMapping("/get-tags")
@ApiOperation("获取所有敏感词的标签数组")
@PreAuthorize("@ss.hasPermission('system:sensitive-word:query')")
public CommonResult<Set<String>> getSensitiveWordTags() throws IOException {
return success(sensitiveWordService.getSensitiveWordTags());
public CommonResult<Set<String>> getSensitiveWordTagSet() {
return success(sensitiveWordService.getSensitiveWordTagSet());
}
@GetMapping("/validate-text")

View File

@ -81,7 +81,7 @@ public interface SensitiveWordService {
*
* @return 标签数组
*/
Set<String> getSensitiveWordTags();
Set<String> getSensitiveWordTagSet();
/**
* 获得文本所包含的不合法的敏感词数组

View File

@ -182,7 +182,7 @@ public class SensitiveWordServiceImpl implements SensitiveWordService {
}
@Override
public Set<String> getSensitiveWordTags() {
public Set<String> getSensitiveWordTagSet() {
return sensitiveWordTagsCache;
}

View File

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.system.service.tenant;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantExportReqVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantPageReqVO;
@ -121,7 +120,7 @@ public interface TenantService {
*
* @return 租户编号数组
*/
List<Long> getTenantIds();
List<Long> getTenantIdList();
/**
* 校验租户是否合法

View File

@ -75,7 +75,7 @@ public class TenantServiceImpl implements TenantService {
private PermissionService permissionService;
@Override
public List<Long> getTenantIds() {
public List<Long> getTenantIdList() {
List<TenantDO> tenants = tenantMapper.selectList();
return CollectionUtils.convertList(tenants, TenantDO::getId);
}

View File

@ -60,7 +60,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest {
// 调用
sensitiveWordService.initLocalCache();
// 断言 sensitiveWordTagsCache 缓存
assertEquals(SetUtils.asSet("论坛", "蔬菜"), sensitiveWordService.getSensitiveWordTags());
assertEquals(SetUtils.asSet("论坛", "蔬菜"), sensitiveWordService.getSensitiveWordTagSet());
// 断言 tagSensitiveWordTries 缓存
assertNotNull(sensitiveWordService.getDefaultSensitiveWordTrie());
assertEquals(2, sensitiveWordService.getTagSensitiveWordTries().size());

View File

@ -81,13 +81,13 @@ public class TenantServiceImplTest extends BaseDbUnitTest {
}
@Test
public void testGetTenantIds() {
public void testGetTenantIdList() {
// mock 数据
TenantDO tenant = randomPojo(TenantDO.class, o -> o.setId(1L));
tenantMapper.insert(tenant);
// 调用并断言业务异常
List<Long> result = tenantService.getTenantIds();
List<Long> result = tenantService.getTenantIdList();
assertEquals(Collections.singletonList(1L), result);
}