|
@@ -35,31 +35,32 @@ public class RedisConfig {
|
|
|
@Bean
|
|
|
public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) {
|
|
|
return new RedisCacheManager(RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory),
|
|
|
- this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_DEFAULT_EXPIRE_TIME), // 默认策略,未配置的 key 会使用这个
|
|
|
- this.getRedisCacheConfigurationMap() // 指定 key 策略
|
|
|
+ this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_DEFAULT_EXPIRE_TIME)
|
|
|
+// , // 默认策略,未配置的 key 会使用这个
|
|
|
+// this.getRedisCacheConfigurationMap() // 指定 key 策略
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- private Map<String, RedisCacheConfiguration> getRedisCacheConfigurationMap() {
|
|
|
- Map<String, RedisCacheConfiguration> redisCacheConfigurationMap = new HashMap<>();
|
|
|
- redisCacheConfigurationMap.put(SystemConstant.userOauth,
|
|
|
- this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
- redisCacheConfigurationMap.put(SystemConstant.studentOauth,
|
|
|
- this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
- redisCacheConfigurationMap.put(SystemConstant.userAccount,
|
|
|
- this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
- redisCacheConfigurationMap.put(SystemConstant.studentAccount,
|
|
|
- this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
- redisCacheConfigurationMap.put(SystemConstant.orgCache,
|
|
|
- this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
- redisCacheConfigurationMap.put(SystemConstant.orgCodeCache,
|
|
|
- this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
- redisCacheConfigurationMap.put(SystemConstant.roleCache,
|
|
|
- this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
- redisCacheConfigurationMap.put(SystemConstant.configCache,
|
|
|
- this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
- return redisCacheConfigurationMap;
|
|
|
- }
|
|
|
+// private Map<String, RedisCacheConfiguration> getRedisCacheConfigurationMap() {
|
|
|
+// Map<String, RedisCacheConfiguration> redisCacheConfigurationMap = new HashMap<>();
|
|
|
+// redisCacheConfigurationMap.put(SystemConstant.userOauth,
|
|
|
+// this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
+// redisCacheConfigurationMap.put(SystemConstant.studentOauth,
|
|
|
+// this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
+// redisCacheConfigurationMap.put(SystemConstant.userAccount,
|
|
|
+// this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
+// redisCacheConfigurationMap.put(SystemConstant.studentAccount,
|
|
|
+// this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
+// redisCacheConfigurationMap.put(SystemConstant.orgCache,
|
|
|
+// this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
+// redisCacheConfigurationMap.put(SystemConstant.orgCodeCache,
|
|
|
+// this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
+// redisCacheConfigurationMap.put(SystemConstant.roleCache,
|
|
|
+// this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
+// redisCacheConfigurationMap.put(SystemConstant.configCache,
|
|
|
+// this.getRedisCacheConfigurationWithTtl(SystemConstant.REDIS_EXPIRE_TIME));
|
|
|
+// return redisCacheConfigurationMap;
|
|
|
+// }
|
|
|
|
|
|
private RedisCacheConfiguration getRedisCacheConfigurationWithTtl(Long seconds) {
|
|
|
Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(
|