Commit b73cdd15b563a719939db310cabbf56bc02b49ee
1 parent
25e7c8dc
同步 Master 最新代码
Showing
2 changed files
with
3 additions
and
2 deletions
yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java
| @@ -119,6 +119,8 @@ public class YudaoTenantAutoConfiguration { | @@ -119,6 +119,8 @@ public class YudaoTenantAutoConfiguration { | ||
| 119 | }; | 119 | }; |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | + // ========== Redis ========== | ||
| 123 | + | ||
| 122 | @Bean | 124 | @Bean |
| 123 | @Primary // 引入租户时,tenantRedisCacheManager 为主 Bean | 125 | @Primary // 引入租户时,tenantRedisCacheManager 为主 Bean |
| 124 | public RedisCacheManager tenantRedisCacheManager(RedisTemplate<String, Object> redisTemplate, | 126 | public RedisCacheManager tenantRedisCacheManager(RedisTemplate<String, Object> redisTemplate, |
yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/redis/TenantRedisCacheManager.java
| @@ -2,7 +2,6 @@ package cn.iocoder.yudao.framework.tenant.core.redis; | @@ -2,7 +2,6 @@ package cn.iocoder.yudao.framework.tenant.core.redis; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; | 3 | import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; |
| 4 | import lombok.extern.slf4j.Slf4j; | 4 | import lombok.extern.slf4j.Slf4j; |
| 5 | -import org.jetbrains.annotations.NotNull; | ||
| 6 | import org.springframework.cache.Cache; | 5 | import org.springframework.cache.Cache; |
| 7 | import org.springframework.data.redis.cache.RedisCacheConfiguration; | 6 | import org.springframework.data.redis.cache.RedisCacheConfiguration; |
| 8 | import org.springframework.data.redis.cache.RedisCacheManager; | 7 | import org.springframework.data.redis.cache.RedisCacheManager; |
| @@ -24,7 +23,7 @@ public class TenantRedisCacheManager extends RedisCacheManager { | @@ -24,7 +23,7 @@ public class TenantRedisCacheManager extends RedisCacheManager { | ||
| 24 | } | 23 | } |
| 25 | 24 | ||
| 26 | @Override | 25 | @Override |
| 27 | - public Cache getCache(@NotNull String name) { | 26 | + public Cache getCache(String name) { |
| 28 | // 如果开启多租户,则 name 拼接租户后缀 | 27 | // 如果开启多租户,则 name 拼接租户后缀 |
| 29 | if (!TenantContextHolder.isIgnore() | 28 | if (!TenantContextHolder.isIgnore() |
| 30 | && TenantContextHolder.getTenantId() != null) { | 29 | && TenantContextHolder.getTenantId() != null) { |