From 1d3ca8a990603071f9be8ac882cf9a8bdb7008d3 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 2 Feb 2023 23:47:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=20TenantServiceImpl=20?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/system/service/tenant/TenantServiceImpl.java | 6 +++--- .../module/system/service/tenant/TenantServiceImplTest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java index 35f100210..3045e7573 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java @@ -138,7 +138,7 @@ public class TenantServiceImpl implements TenantService { @Transactional(rollbackFor = Exception.class) public void updateTenant(TenantUpdateReqVO updateReqVO) { // 校验存在 - TenantDO tenant = checkUpdateTenant(updateReqVO.getId()); + TenantDO tenant = validateUpdateTenant(updateReqVO.getId()); // 校验套餐被禁用 TenantPackageDO tenantPackage = tenantPackageService.validTenantPackage(updateReqVO.getPackageId()); @@ -179,12 +179,12 @@ public class TenantServiceImpl implements TenantService { @Override public void deleteTenant(Long id) { // 校验存在 - checkUpdateTenant(id); + validateUpdateTenant(id); // 删除 tenantMapper.deleteById(id); } - private TenantDO checkUpdateTenant(Long id) { + private TenantDO validateUpdateTenant(Long id) { TenantDO tenant = tenantMapper.selectById(id); if (tenant == null) { throw exception(TENANT_NOT_EXISTS); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java index 8cee678db..9e33f87fa 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java @@ -196,7 +196,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest { role100.setTenantId(dbTenant.getId()); RoleDO role101 = randomPojo(RoleDO.class, o -> o.setId(101L)); role101.setTenantId(dbTenant.getId()); - when(roleService.getRoleList(isNull())).thenReturn(asList(role100, role101)); + when(roleService.getRoleListByStatus(isNull())).thenReturn(asList(role100, role101)); // mock 每个角色的权限 when(permissionService.getRoleMenuIds(eq(101L))).thenReturn(asSet(201L, 202L));