|
@@ -26,14 +26,13 @@ import java.time.Duration;
|
|
|
public class BaseRedisConfig {
|
|
|
|
|
|
@Bean
|
|
|
- public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
|
|
- RedisSerializer<Object> serializer = redisSerializer();
|
|
|
+ public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory,RedisSerializer<Object> redisSerializer) {
|
|
|
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
|
|
redisTemplate.setConnectionFactory(redisConnectionFactory);
|
|
|
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
|
|
- redisTemplate.setValueSerializer(serializer);
|
|
|
+ redisTemplate.setValueSerializer(redisSerializer);
|
|
|
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
|
|
|
- redisTemplate.setHashValueSerializer(serializer);
|
|
|
+ redisTemplate.setHashValueSerializer(redisSerializer);
|
|
|
redisTemplate.afterPropertiesSet();
|
|
|
return redisTemplate;
|
|
|
}
|