用以自定义的方式,SpringBoot解决Redis序列化问题(包括自定义的时间序列化方法)
发布时间
阅读量:
阅读量
此自定义方式解决了取出来的value值都是linkedhashmap问题。
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.joda.time.DateTime;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRed
全部评论 (0)
还没有任何评论哟~
