system:将 biz 的方法名的负数都换成 List
This commit is contained in:
parent
d5fe4a3c89
commit
f6d259b620
@ -22,7 +22,7 @@ public class TenantApiImpl implements TenantApi {
|
||||
|
||||
@Override
|
||||
public CommonResult<List<Long>> getTenantIdList() {
|
||||
return success(tenantService.getTenantIds());
|
||||
return success(tenantService.getTenantIdList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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()));
|
||||
// 获得用户拥有的菜单列表
|
||||
|
@ -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());
|
||||
|
@ -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()));
|
||||
// 排序后,返回给前端
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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")
|
||||
|
@ -81,7 +81,7 @@ public interface SensitiveWordService {
|
||||
*
|
||||
* @return 标签数组
|
||||
*/
|
||||
Set<String> getSensitiveWordTags();
|
||||
Set<String> getSensitiveWordTagSet();
|
||||
|
||||
/**
|
||||
* 获得文本所包含的不合法的敏感词数组
|
||||
|
@ -182,7 +182,7 @@ public class SensitiveWordServiceImpl implements SensitiveWordService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getSensitiveWordTags() {
|
||||
public Set<String> getSensitiveWordTagSet() {
|
||||
return sensitiveWordTagsCache;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
||||
/**
|
||||
* 校验租户是否合法
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user