From c18f3b01d34a85a99cb5348e3e32baf1cff8bbd7 Mon Sep 17 00:00:00 2001 From: smallchill Date: Sun, 20 Oct 2024 11:51:20 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20TenantIdUtil=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E4=B8=BATenantUtil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/springblade/core/tenant/BladeTenantHandler.java | 4 ++-- .../core/tenant/{TenantIdUtil.java => TenantUtil.java} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename blade-starter-tenant/src/main/java/org/springblade/core/tenant/{TenantIdUtil.java => TenantUtil.java} (96%) 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;