Commit f202f19d authored by shiyu's avatar shiyu

RedisUtils

parent 31652883
...@@ -12,6 +12,7 @@ import org.springframework.data.redis.core.Cursor; ...@@ -12,6 +12,7 @@ import org.springframework.data.redis.core.Cursor;
import org.springframework.data.redis.core.RedisConnectionUtils; import org.springframework.data.redis.core.RedisConnectionUtils;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ScanOptions; import org.springframework.data.redis.core.ScanOptions;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -30,6 +31,7 @@ public class RedisUtils { ...@@ -30,6 +31,7 @@ public class RedisUtils {
this.redisTemplate = redisTemplate; this.redisTemplate = redisTemplate;
this.redisTemplate.setHashKeySerializer(new StringRedisSerializer()); this.redisTemplate.setHashKeySerializer(new StringRedisSerializer());
this.redisTemplate.setKeySerializer(new StringRedisSerializer()); this.redisTemplate.setKeySerializer(new StringRedisSerializer());
this.redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
this.redisTemplate.setStringSerializer(new StringRedisSerializer()); this.redisTemplate.setStringSerializer(new StringRedisSerializer());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment