reactor:@TenantIgnore 添加在 Controller 时,自动添加到 TenantProperties 中

(cherry picked from commit f92f9d2e1733f257dcf3fbe155b34079cba0d211)
This commit is contained in:
YunaiV 2025-05-05 10:23:58 +08:00 committed by dengqichen
parent d881cce65b
commit 5d5b715b55
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet;
import java.util.Set; import java.util.Set;
/** /**
@ -30,7 +31,7 @@ public class TenantProperties {
* *
* 默认情况下每个请求需要带上 tenant-id 的请求头但是部分请求是无需带上的例如说短信回调支付回调等 Open API * 默认情况下每个请求需要带上 tenant-id 的请求头但是部分请求是无需带上的例如说短信回调支付回调等 Open API
*/ */
private Set<String> ignoreUrls = Collections.emptySet(); private Set<String> ignoreUrls = new HashSet<>();
/** /**
* 需要忽略多租户的表 * 需要忽略多租户的表

View File

@ -26,7 +26,7 @@ public class TenantApiImpl implements TenantApi {
} }
@Override @Override
@GetMapping // 获得租户列表的时候无需传递租户编号 @TenantIgnore // 获得租户列表的时候无需传递租户编号
public CommonResult<Boolean> validTenant(Long id) { public CommonResult<Boolean> validTenant(Long id) {
tenantService.validTenant(id); tenantService.validTenant(id);
return success(true); return success(true);