diff --git a/blade-starter-tenant/src/main/java/org/springblade/core/tenant/BladeTenantHandler.java b/blade-starter-tenant/src/main/java/org/springblade/core/tenant/BladeTenantHandler.java index 7a2a744..9b1b8ea 100644 --- a/blade-starter-tenant/src/main/java/org/springblade/core/tenant/BladeTenantHandler.java +++ b/blade-starter-tenant/src/main/java/org/springblade/core/tenant/BladeTenantHandler.java @@ -41,7 +41,7 @@ public class BladeTenantHandler implements TenantLineHandler { */ @Override public Expression getTenantId() { - return new StringValue(Func.toStr(TenantIdUtil.get(), properties.getDefaultTenantId())); + return new StringValue(Func.toStr(TenantUtil.getTenantId(), properties.getDefaultTenantId())); } /** @@ -67,7 +67,7 @@ public class BladeTenantHandler implements TenantLineHandler { (!properties.getTables().isEmpty() && properties.getTables().contains(tableName)) || properties.getBladeTables().contains(tableName) ) - && StringUtil.isNotBlank(TenantIdUtil.get()) + && StringUtil.isNotBlank(TenantUtil.getTenantId()) ); } } diff --git a/blade-starter-tenant/src/main/java/org/springblade/core/tenant/TenantIdUtil.java b/blade-starter-tenant/src/main/java/org/springblade/core/tenant/TenantUtil.java similarity index 96% rename from blade-starter-tenant/src/main/java/org/springblade/core/tenant/TenantIdUtil.java rename to blade-starter-tenant/src/main/java/org/springblade/core/tenant/TenantUtil.java index c5f6246..f33b581 100644 --- a/blade-starter-tenant/src/main/java/org/springblade/core/tenant/TenantIdUtil.java +++ b/blade-starter-tenant/src/main/java/org/springblade/core/tenant/TenantUtil.java @@ -27,7 +27,7 @@ import java.util.function.Supplier; * @author L.cm */ @UtilityClass -public class TenantIdUtil { +public class TenantUtil { private static final ThreadLocal tl = new ThreadLocal<>(); /** @@ -35,7 +35,7 @@ public class TenantIdUtil { * * @return 租户id */ - public static String get() { + public static String getTenantId() { String tenantId = tl.get(); if (tenantId != null) { return tenantId;