public class RedisAutoCacheManager extends RedisCacheManager { public RedisAutoCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration) { super(cacheWriter, defaultCacheConfiguration); }
/** * 从上下文中获取租户ID,重写@Cacheable value值 * @param name * @return */ @Override public Cache getCache(String name) { return super.getCache( name + StrUtil.COLON + TenantContextHolder.getTenantId()); } }