提交 293c2fd8 编写于 作者: sq3536's avatar sq3536

Merge remote-tracking branch 'origin/dev' into dev

......@@ -7,12 +7,12 @@ import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.CaffeineSpec;
import lombok.Data;
import ${pub.getPKGCodeName()}.util.cache.cache.LayeringCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheWriter;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
......@@ -39,7 +39,8 @@ public class LayeringCacheManager implements CacheManager {
private final ConcurrentMap<String, Cache> cacheMap = new ConcurrentHashMap<String, Cache>(16);
public RedisCacheWriter redisCacheWriter;
public RedisCacheConfiguration redisConfiguration;
public RedisOperations redisOperations;
@Autowired
public RedisTemplate<String, Object> redisTemplate;
/**
* 缓存默认设置
......@@ -49,10 +50,6 @@ public class LayeringCacheManager implements CacheManager {
.initialCapacity(DEFAULT_INITIAL_CAPACITY)
.maximumSize(DEFAULT_MAXIMUM_SIZE);
public LayeringCacheManager(RedisTemplate<String, Object> redisTemplate) {
this.redisOperations=redisTemplate;
}
/**
* 获取缓存对象
* @param name
......@@ -79,7 +76,7 @@ public class LayeringCacheManager implements CacheManager {
}
protected Cache createCache(String name) {
return new LayeringCache(name,this.redisOperations ,this.cacheBuilder.build(),redisCacheWriter,redisConfiguration);
return new LayeringCache(name,redisTemplate,this.cacheBuilder.build(),redisCacheWriter,redisConfiguration);
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册