Commit b73cdd15b563a719939db310cabbf56bc02b49ee

Authored by YunaiV
1 parent 25e7c8dc

同步 Master 最新代码

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 119 };
120 120 }
121 121  
  122 + // ========== Redis ==========
  123 +
122 124 @Bean
123 125 @Primary // 引入租户时,tenantRedisCacheManager 为主 Bean
124 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 2  
3 3 import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
4 4 import lombok.extern.slf4j.Slf4j;
5   -import org.jetbrains.annotations.NotNull;
6 5 import org.springframework.cache.Cache;
7 6 import org.springframework.data.redis.cache.RedisCacheConfiguration;
8 7 import org.springframework.data.redis.cache.RedisCacheManager;
... ... @@ -24,7 +23,7 @@ public class TenantRedisCacheManager extends RedisCacheManager {
24 23 }
25 24  
26 25 @Override
27   - public Cache getCache(@NotNull String name) {
  26 + public Cache getCache(String name) {
28 27 // 如果开启多租户,则 name 拼接租户后缀
29 28 if (!TenantContextHolder.isIgnore()
30 29 && TenantContextHolder.getTenantId() != null) {
... ...