From 1dd597025aba8144d8af093d38045138287f6499 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Wed, 30 Aug 2023 09:58:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.0=E3=80=91=E3=80=90tenant=E3=80=91?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A7=E7=A7=9F=E6=88=B7=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kernel/rule/constants/RuleConstants.java | 5 -- .../rule/constants/TenantConstants.java | 21 ------- .../rule/tenant/OnceTenantCodeHolder.java | 45 -------------- .../rule/tenant/RequestTenantCodeHolder.java | 45 -------------- .../kernel/rule/tenant/TenantPrefixApi.java | 19 ------ .../kernel/auth/auth/AuthServiceImpl.java | 27 ++------- .../roses/kernel/auth/auth/LoginService.java | 4 -- .../TenantCodeRemoveThreadLocalHolder.java | 21 ------- .../kernel/cache/api/CacheOperatorApi.java | 58 +----------------- .../cache/api/tenant/TenantCacheProxy.java | 59 ------------------- .../api/tenant/TenantCacheProxyFactory.java | 44 -------------- .../kernel/db/api/util/DatabaseUtil.java | 6 +- .../DatasourceContainerExceptionEnum.java | 5 -- .../service/impl/DatabaseInfoServiceImpl.java | 6 -- .../service/TableUniqueValueService.java | 35 ++--------- .../sys/modular/org/entity/HrOrgApprover.java | 7 --- .../modular/userapp/entity/PortalUserApp.java | 7 --- 17 files changed, 12 insertions(+), 402 deletions(-) delete mode 100644 kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/constants/TenantConstants.java delete mode 100644 kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/OnceTenantCodeHolder.java delete mode 100644 kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/RequestTenantCodeHolder.java delete mode 100644 kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/TenantPrefixApi.java delete mode 100644 kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/callback/TenantCodeRemoveThreadLocalHolder.java delete mode 100644 kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/tenant/TenantCacheProxy.java delete mode 100644 kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/tenant/TenantCacheProxyFactory.java diff --git a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/constants/RuleConstants.java b/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/constants/RuleConstants.java index 2dfae5e2a..164c57b0b 100644 --- a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/constants/RuleConstants.java +++ b/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/constants/RuleConstants.java @@ -82,11 +82,6 @@ public interface RuleConstants { */ String CHINESE_TRAN_LANGUAGE_CODE = "chinese"; - /** - * 租户数据源标识前缀 - */ - String TENANT_DB_PREFIX = "sys_tenant_db_"; - /** * base64图片前缀,用在给使用 */ diff --git a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/constants/TenantConstants.java b/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/constants/TenantConstants.java deleted file mode 100644 index 8f5b9e064..000000000 --- a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/constants/TenantConstants.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.stylefeng.roses.kernel.rule.constants; - -/** - * 租户数据常量,如果租户业务变了这里也需要修改 - * - * @author fengshuonan - * @since 2021/9/24 17:20 - */ -public interface TenantConstants { - - /** - * 租户库的前缀 - */ - String TENANT_DB_PREFIX = "sys_tenant_db_"; - - /** - * master数据源名称 - */ - String MASTER_DATASOURCE_NAME = "master"; - -} diff --git a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/OnceTenantCodeHolder.java b/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/OnceTenantCodeHolder.java deleted file mode 100644 index ba1e156c4..000000000 --- a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/OnceTenantCodeHolder.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.stylefeng.roses.kernel.rule.tenant; - -/** - * 租户编码信息暂存,一般给缓存使用 - *

- * 一次性使用,使用完就立即释放 - * - * @author fengshuonan - * @since 2022/11/8 0:58 - */ -public class OnceTenantCodeHolder { - - private static final ThreadLocal CONTEXT_HOLDER = new ThreadLocal<>(); - - /** - * 设置租户编码 - * - * @author fengshuonan - * @since 2022/11/8 0:59 - */ - public static void setTenantCode(String aesKey) { - CONTEXT_HOLDER.set(aesKey); - } - - /** - * 获取租户编码 - * - * @author fengshuonan - * @since 2022/11/8 0:59 - */ - public static String getTenantCode() { - return CONTEXT_HOLDER.get(); - } - - /** - * 清除租户编码 - * - * @author fengshuonan - * @since 2022/11/8 0:59 - */ - public static void clearTenantCode() { - CONTEXT_HOLDER.remove(); - } - -} diff --git a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/RequestTenantCodeHolder.java b/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/RequestTenantCodeHolder.java deleted file mode 100644 index df0c2ba62..000000000 --- a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/RequestTenantCodeHolder.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.stylefeng.roses.kernel.rule.tenant; - -/** - * 租户编码信息暂存,一般给缓存使用 - *

- * 在一次Http请求中生效,一般用在登录接口,当前Context没有LoginUser时使用 - * - * @author fengshuonan - * @since 2022/11/8 0:58 - */ -public class RequestTenantCodeHolder { - - private static final ThreadLocal CONTEXT_HOLDER = new ThreadLocal<>(); - - /** - * 设置租户编码 - * - * @author fengshuonan - * @since 2022/11/8 0:59 - */ - public static void setTenantCode(String aesKey) { - CONTEXT_HOLDER.set(aesKey); - } - - /** - * 获取租户编码 - * - * @author fengshuonan - * @since 2022/11/8 0:59 - */ - public static String getTenantCode() { - return CONTEXT_HOLDER.get(); - } - - /** - * 清除租户编码 - * - * @author fengshuonan - * @since 2022/11/8 0:59 - */ - public static void clearTenantCode() { - CONTEXT_HOLDER.remove(); - } - -} diff --git a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/TenantPrefixApi.java b/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/TenantPrefixApi.java deleted file mode 100644 index c4a2efb9c..000000000 --- a/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/tenant/TenantPrefixApi.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.stylefeng.roses.kernel.rule.tenant; - -/** - * 租户前缀获取 - * - * @author fengshuonan - * @since 2022/11/7 20:16 - */ -public interface TenantPrefixApi { - - /** - * 获取当前用户的租户前缀 - * - * @author fengshuonan - * @since 2022/11/7 20:29 - */ - String getTenantPrefix(); - -} diff --git a/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/AuthServiceImpl.java b/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/AuthServiceImpl.java index 7f02e47dd..cf11f0ab6 100644 --- a/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/AuthServiceImpl.java +++ b/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/AuthServiceImpl.java @@ -44,15 +44,12 @@ import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser; import cn.stylefeng.roses.kernel.auth.api.pojo.payload.DefaultJwtPayload; import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; import cn.stylefeng.roses.kernel.demo.expander.DemoConfigExpander; -import cn.stylefeng.roses.kernel.dsctn.api.constants.DatasourceContainerConstants; -import cn.stylefeng.roses.kernel.dsctn.api.context.CurrentDataSourceContext; import cn.stylefeng.roses.kernel.jwt.JwtTokenOperator; import cn.stylefeng.roses.kernel.jwt.api.JwtApi; import cn.stylefeng.roses.kernel.jwt.api.exception.JwtException; import cn.stylefeng.roses.kernel.jwt.api.exception.enums.JwtExceptionEnum; import cn.stylefeng.roses.kernel.jwt.api.pojo.config.JwtConfig; import cn.stylefeng.roses.kernel.log.api.LoginLogServiceApi; -import cn.stylefeng.roses.kernel.rule.constants.RuleConstants; import cn.stylefeng.roses.kernel.sys.api.SysUserServiceApi; import cn.stylefeng.roses.kernel.sys.api.pojo.user.UserValidateDTO; import com.alibaba.fastjson.JSON; @@ -243,28 +240,16 @@ public class AuthServiceImpl implements AuthServiceApi { // 获取用户的信息 String account = defaultJwtPayload.getAccount(); - // 获取用户租户信息 - String tenantCode = defaultJwtPayload.getTenantCode(); - LoginUser loginUser; - try { - // 如果有特定租户则进行切换操作 - if (StrUtil.isNotEmpty(tenantCode) && !DatasourceContainerConstants.MASTER_DATASOURCE_NAME.equals(tenantCode)) { - CurrentDataSourceContext.setDataSourceName(RuleConstants.TENANT_DB_PREFIX + tenantCode); - } - // 获取用户信息 - UserValidateDTO userValidateDTO = sysUserServiceApi.getUserLoginValidateDTO(account); + // 获取用户信息 + UserValidateDTO userValidateDTO = sysUserServiceApi.getUserLoginValidateDTO(account); - // 创建登录用户 - loginUser = new LoginUser(userValidateDTO.getUserId(), token); + // 创建登录用户 + loginUser = new LoginUser(userValidateDTO.getUserId(), token); - // 创建用户会话信息 - sessionManagerApi.updateSession(token, loginUser); - } finally { - // 清除租户信息 - CurrentDataSourceContext.clearDataSourceName(); - } + // 创建用户会话信息 + sessionManagerApi.updateSession(token, loginUser); return loginUser; } diff --git a/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/LoginService.java b/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/LoginService.java index 959690b04..6c7cff290 100644 --- a/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/LoginService.java +++ b/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/LoginService.java @@ -26,7 +26,6 @@ import cn.stylefeng.roses.kernel.auth.api.pojo.sso.SsoProperties; import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; import cn.stylefeng.roses.kernel.demo.expander.DemoConfigExpander; import cn.stylefeng.roses.kernel.log.api.LoginLogServiceApi; -import cn.stylefeng.roses.kernel.rule.tenant.RequestTenantCodeHolder; import cn.stylefeng.roses.kernel.rule.util.HttpServletUtil; import cn.stylefeng.roses.kernel.scanner.api.exception.ScannerException; import cn.stylefeng.roses.kernel.scanner.api.exception.enums.ScannerExceptionEnum; @@ -103,9 +102,6 @@ public class LoginService { // 1.2 判断账号是否密码重试次数过多被冻结 Integer loginErrorCount = validatePasswordRetryTimes(loginRequest); - // 1.3 暂存多租户编码(v7.3.2增加,方便缓存调用过程中获取多租户的前缀) - RequestTenantCodeHolder.setTenantCode(loginRequest.getTenantCode()); - // 2. 如果开启了验证码校验,则验证当前请求的验证码是否正确 validateCaptcha(loginRequest); diff --git a/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/callback/TenantCodeRemoveThreadLocalHolder.java b/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/callback/TenantCodeRemoveThreadLocalHolder.java deleted file mode 100644 index 2bf1ff7b8..000000000 --- a/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/callback/TenantCodeRemoveThreadLocalHolder.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.stylefeng.roses.kernel.auth.callback; - -import cn.stylefeng.roses.kernel.rule.tenant.RequestTenantCodeHolder; -import cn.stylefeng.roses.kernel.rule.threadlocal.RemoveThreadLocalApi; -import org.springframework.stereotype.Component; - -/** - * 清除参数缓存相关的ThreadLocal - * - * @author fengshuonan - * @since 2021/10/29 11:37 - */ -@Component -public class TenantCodeRemoveThreadLocalHolder implements RemoveThreadLocalApi { - - @Override - public void removeThreadLocalAction() { - RequestTenantCodeHolder.clearTenantCode(); - } - -} diff --git a/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/CacheOperatorApi.java b/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/CacheOperatorApi.java index e865ab229..75c67821b 100644 --- a/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/CacheOperatorApi.java +++ b/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/CacheOperatorApi.java @@ -26,9 +26,6 @@ package cn.stylefeng.roses.kernel.cache.api; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.extra.spring.SpringUtil; -import cn.stylefeng.roses.kernel.rule.constants.TenantConstants; -import cn.stylefeng.roses.kernel.rule.tenant.TenantPrefixApi; import java.util.Collection; import java.util.Map; @@ -151,20 +148,6 @@ public interface CacheOperatorApi { */ String getCommonKeyPrefix(); - /** - * 是否按租户维度去切割缓存(不推荐开启) - *

- * key的组成方式:租户前缀:业务前缀:业务key - *

- * 如果不开启租户切割,则租户前缀一直会为master: - * - * @author fengshuonan - * @since 2022/11/9 19:02 - */ - default Boolean divideByTenant() { - return false; - } - /** * 获取最终的计算前缀 *

@@ -174,11 +157,7 @@ public interface CacheOperatorApi { * @since 2022/11/9 10:41 */ default String getFinalPrefix() { - // 获取租户前缀 - String tenantPrefix = getTenantPrefix(); - - // 计算最终前缀 - return tenantPrefix + CACHE_DELIMITER + getCommonKeyPrefix() + CACHE_DELIMITER; + return getCommonKeyPrefix() + CACHE_DELIMITER; } /** @@ -216,39 +195,4 @@ public interface CacheOperatorApi { return StrUtil.removePrefix(finalKey, getFinalPrefix()); } - /** - * 获取租户前缀 - * - * @author fengshuonan - * @since 2022/11/9 10:35 - */ - default String getTenantPrefix() { - - // 缓存是否按租户维度切分 - Boolean divideByTenantFlag = divideByTenant(); - - // 如果不按租户维度切分,则默认都返回为master - if (!divideByTenantFlag) { - return TenantConstants.MASTER_DATASOURCE_NAME; - } - - // 用户的租户前缀 - String tenantPrefix = ""; - try { - TenantPrefixApi tenantPrefixApi = SpringUtil.getBean(TenantPrefixApi.class); - if (tenantPrefixApi != null) { - tenantPrefix = tenantPrefixApi.getTenantPrefix(); - } - } catch (Exception e) { - // 如果找不到这个bean,则没有加载多租户插件 - } - - // 如果租户前缀为空,则设置为主租户的编码 - if (ObjectUtil.isEmpty(tenantPrefix)) { - tenantPrefix = TenantConstants.MASTER_DATASOURCE_NAME; - } - - return tenantPrefix; - } - } diff --git a/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/tenant/TenantCacheProxy.java b/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/tenant/TenantCacheProxy.java deleted file mode 100644 index 417052f41..000000000 --- a/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/tenant/TenantCacheProxy.java +++ /dev/null @@ -1,59 +0,0 @@ -package cn.stylefeng.roses.kernel.cache.api.tenant; - -import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; -import cn.stylefeng.roses.kernel.rule.tenant.OnceTenantCodeHolder; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -/** - * 租户缓存动态代理 - * - * @author fengshuonan - * @since 2022/11/8 0:45 - */ -@SuppressWarnings("all") -public class TenantCacheProxy implements InvocationHandler { - - /** - * 被代理的缓存操作类 - */ - private CacheOperatorApi targetCacheObject = null; - - /** - * 租户编码 - */ - private String tenantCode = null; - - /** - * 绑定缓存操作原始类 - * - * @param tenantCode 租户编码 - * @param target 被代理的缓存类 - * @author fengshuonan - * @since 2022/11/8 1:05 - */ - public CacheOperatorApi bindCacheObject(String tenantCode, CacheOperatorApi target) { - this.targetCacheObject = target; - this.tenantCode = tenantCode; - return (CacheOperatorApi) Proxy.newProxyInstance(target.getClass().getClassLoader(), target.getClass().getSuperclass().getInterfaces(), this); - } - - @Override - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Object result = null; - try { - // 设置租户编码 - OnceTenantCodeHolder.setTenantCode(tenantCode); - - // 执行原有缓存操作类 - result = method.invoke(targetCacheObject, args); - } finally { - // 清除租户编码 - OnceTenantCodeHolder.clearTenantCode(); - } - return result; - } - -} diff --git a/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/tenant/TenantCacheProxyFactory.java b/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/tenant/TenantCacheProxyFactory.java deleted file mode 100644 index 6a4cca19a..000000000 --- a/kernel-d-cache/cache-api/src/main/java/cn/stylefeng/roses/kernel/cache/api/tenant/TenantCacheProxyFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -package cn.stylefeng.roses.kernel.cache.api.tenant; - -import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; - -import java.util.HashMap; -import java.util.Map; - -/** - * 租户缓存动态代理 - * - * @author fengshuonan - * @since 2022/11/8 0:45 - */ -@SuppressWarnings("all") -public class TenantCacheProxyFactory { - - /** - * 存放所有代理的缓存 - */ - private static final Map> proxyCacheMap = new HashMap<>(); - - /** - * 创建带租户控制的缓存代理 - * - * @author fengshuonan - * @since 2022/11/8 1:18 - */ - public static CacheOperatorApi createTenantCacheProxy(String tenantCode, CacheOperatorApi cacheOperatorApi) { - - // 计算缓存的key - String key = tenantCode + cacheOperatorApi.getCommonKeyPrefix(); - - // 直接获取缓存中的代理 - if (proxyCacheMap.containsKey(key)) { - return (CacheOperatorApi) proxyCacheMap.get(key); - } - - TenantCacheProxy tenantCacheProxy = new TenantCacheProxy(); - CacheOperatorApi resultCacheOperator = tenantCacheProxy.bindCacheObject(tenantCode, cacheOperatorApi); - proxyCacheMap.put(key, resultCacheOperator); - return (CacheOperatorApi) resultCacheOperator; - } - -} diff --git a/kernel-d-db/db-api/src/main/java/cn/stylefeng/roses/kernel/db/api/util/DatabaseUtil.java b/kernel-d-db/db-api/src/main/java/cn/stylefeng/roses/kernel/db/api/util/DatabaseUtil.java index fea5495e3..4d9323c61 100644 --- a/kernel-d-db/db-api/src/main/java/cn/stylefeng/roses/kernel/db/api/util/DatabaseUtil.java +++ b/kernel-d-db/db-api/src/main/java/cn/stylefeng/roses/kernel/db/api/util/DatabaseUtil.java @@ -11,7 +11,6 @@ import cn.stylefeng.roses.kernel.db.api.sqladapter.database.CreateDatabaseSql; import cn.stylefeng.roses.kernel.db.api.sqladapter.database.GetDatabasesSql; import cn.stylefeng.roses.kernel.db.api.sqladapter.table.TableFieldListSql; import cn.stylefeng.roses.kernel.db.api.sqladapter.table.TableListSql; -import cn.stylefeng.roses.kernel.rule.constants.RuleConstants; import lombok.extern.slf4j.Slf4j; import java.sql.Connection; @@ -48,10 +47,7 @@ public class DatabaseUtil { while (resultSet.next()) { String database = resultSet.getString("database"); if (StrUtil.isNotBlank(database)) { - if (StrUtil.startWith(database, RuleConstants.TENANT_DB_PREFIX)) { - database = database.replaceAll(RuleConstants.TENANT_DB_PREFIX, ""); - databasesList.add(database); - } + databasesList.add(database); } } return databasesList; diff --git a/kernel-d-ds-container/ds-container-api/src/main/java/cn/stylefeng/roses/kernel/dsctn/api/exception/enums/DatasourceContainerExceptionEnum.java b/kernel-d-ds-container/ds-container-api/src/main/java/cn/stylefeng/roses/kernel/dsctn/api/exception/enums/DatasourceContainerExceptionEnum.java index 1bbc3891b..cf0e224cd 100644 --- a/kernel-d-ds-container/ds-container-api/src/main/java/cn/stylefeng/roses/kernel/dsctn/api/exception/enums/DatasourceContainerExceptionEnum.java +++ b/kernel-d-ds-container/ds-container-api/src/main/java/cn/stylefeng/roses/kernel/dsctn/api/exception/enums/DatasourceContainerExceptionEnum.java @@ -88,11 +88,6 @@ public enum DatasourceContainerExceptionEnum implements AbstractExceptionEnum { */ EDIT_DATASOURCE_NAME_ERROR(RuleConstants.BUSINESS_ERROR_TYPE_CODE + DatasourceContainerConstants.DS_CTN_EXCEPTION_STEP_CODE + "10", "修改数据源失败,不能修改数据源名称,原名称为={}"), - /** - * 租户数据源不能删除 - */ - TENANT_DATASOURCE_CANT_DELETE(RuleConstants.BUSINESS_ERROR_TYPE_CODE + DatasourceContainerConstants.DS_CTN_EXCEPTION_STEP_CODE + "11", "租户数据源不能删除"), - /** * 数据源信息不存在 */ diff --git a/kernel-d-ds-container/ds-container-business/src/main/java/cn/stylefeng/roses/kernel/dsctn/modular/service/impl/DatabaseInfoServiceImpl.java b/kernel-d-ds-container/ds-container-business/src/main/java/cn/stylefeng/roses/kernel/dsctn/modular/service/impl/DatabaseInfoServiceImpl.java index bd0e7ef6f..873d7aed1 100644 --- a/kernel-d-ds-container/ds-container-business/src/main/java/cn/stylefeng/roses/kernel/dsctn/modular/service/impl/DatabaseInfoServiceImpl.java +++ b/kernel-d-ds-container/ds-container-business/src/main/java/cn/stylefeng/roses/kernel/dsctn/modular/service/impl/DatabaseInfoServiceImpl.java @@ -47,7 +47,6 @@ import cn.stylefeng.roses.kernel.group.api.GroupApi; import cn.stylefeng.roses.kernel.group.api.constants.GroupConstants; import cn.stylefeng.roses.kernel.group.api.pojo.SysGroupDTO; import cn.stylefeng.roses.kernel.group.api.pojo.SysGroupRequest; -import cn.stylefeng.roses.kernel.rule.constants.RuleConstants; import cn.stylefeng.roses.kernel.rule.enums.DbTypeEnum; import cn.stylefeng.roses.kernel.rule.enums.StatusEnum; import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum; @@ -167,11 +166,6 @@ public class DatabaseInfoServiceImpl extends ServiceImpl