Commit 034de50999fd321f5284e9c07c2f440193ad44f9
1 parent
b73cdd15
完善多租户的注释与代码
Showing
3 changed files
with
5 additions
and
4 deletions
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/DocumentEnum.java
| ... | ... | @@ -12,7 +12,8 @@ import lombok.Getter; |
| 12 | 12 | @AllArgsConstructor |
| 13 | 13 | public enum DocumentEnum { |
| 14 | 14 | |
| 15 | - REDIS_INSTALL("https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues/I4VCSJ", "Redis 安装文档"); | |
| 15 | + REDIS_INSTALL("https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues/I4VCSJ", "Redis 安装文档"), | |
| 16 | + TENANT("https://doc.iocoder.cn", "SaaS 多租户文档"); | |
| 16 | 17 | |
| 17 | 18 | private final String url; |
| 18 | 19 | private final String memo; | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/context/TenantContextHolder.java
| 1 | 1 | package cn.iocoder.yudao.framework.tenant.core.context; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.DocumentEnum; | |
| 3 | 4 | import com.alibaba.ttl.TransmittableThreadLocal; |
| 4 | 5 | |
| 5 | 6 | /** |
| ... | ... | @@ -36,7 +37,8 @@ public class TenantContextHolder { |
| 36 | 37 | public static Long getRequiredTenantId() { |
| 37 | 38 | Long tenantId = getTenantId(); |
| 38 | 39 | if (tenantId == null) { |
| 39 | - throw new NullPointerException("TenantContextHolder 不存在租户编号"); // TODO 芋艿:增加文档链接 | |
| 40 | + throw new NullPointerException("TenantContextHolder 不存在租户编号!可参考文档:" | |
| 41 | + + DocumentEnum.TENANT.getUrl()); | |
| 40 | 42 | } |
| 41 | 43 | return tenantId; |
| 42 | 44 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/security/TenantSecurityWebFilter.java