2026-06-24 f4bd1f3c89d906131495a0aca5aaf82966378510
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package cn.iocoder.yudao.framework.tenant.config;
 
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
 
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
 
/**
 * 多租户配置
 *
 * @author 芋道源码
 */
@ConfigurationProperties(prefix = "yudao.tenant")
@Data
public class TenantProperties {
 
    /**
     * 租户是否开启
     */
    private static final Boolean ENABLE_DEFAULT = true;
 
    /**
     * 是否开启
     */
    private Boolean enable = ENABLE_DEFAULT;
 
    /**
     * 需要忽略多租户的请求
     *
     * 默认情况下,每个请求需要带上 tenant-id 的请求头。但是,部分请求是无需带上的,例如说短信回调、支付回调等 Open API!
     */
    private Set<String> ignoreUrls = new HashSet<>();
 
    /**
     * 需要忽略跨(切换)租户访问的请求
     *
     * 原因是:某些接口,访问的是个人信息,在跨租户是获取不到的!
     */
    private Set<String> ignoreVisitUrls = Collections.emptySet();
 
    /**
     * 需要忽略多租户的表
     *
     * 即默认所有表都开启多租户的功能,所以记得添加对应的 tenant_id 字段哟
     */
    private Set<String> ignoreTables = Collections.emptySet();
 
    /**
     * 需要忽略多租户的 Spring Cache 缓存
     *
     * 即默认所有缓存都开启多租户的功能,所以记得添加对应的 tenant_id 字段哟
     */
    private Set<String> ignoreCaches = Collections.emptySet();
 
}