TenantIdUtil重命名为TenantUtil

This commit is contained in:
smallchill 2024-10-20 11:51:20 +08:00
parent d5bfa065ee
commit c18f3b01d3
2 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ public class BladeTenantHandler implements TenantLineHandler {
*/ */
@Override @Override
public Expression getTenantId() { 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.getTables().isEmpty() && properties.getTables().contains(tableName))
|| properties.getBladeTables().contains(tableName) || properties.getBladeTables().contains(tableName)
) )
&& StringUtil.isNotBlank(TenantIdUtil.get()) && StringUtil.isNotBlank(TenantUtil.getTenantId())
); );
} }
} }

View File

@ -27,7 +27,7 @@ import java.util.function.Supplier;
* @author L.cm * @author L.cm
*/ */
@UtilityClass @UtilityClass
public class TenantIdUtil { public class TenantUtil {
private static final ThreadLocal<String> tl = new ThreadLocal<>(); private static final ThreadLocal<String> tl = new ThreadLocal<>();
/** /**
@ -35,7 +35,7 @@ public class TenantIdUtil {
* *
* @return 租户id * @return 租户id
*/ */
public static String get() { public static String getTenantId() {
String tenantId = tl.get(); String tenantId = tl.get();
if (tenantId != null) { if (tenantId != null) {
return tenantId; return tenantId;