| | |
| | | import org.springframework.context.annotation.Configuration; |
| | | 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.StringRedisSerializer; |
| | | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
| | | import com.fasterxml.jackson.annotation.JsonTypeInfo; |
| | |
| | | |
| | | /** |
| | | * redis閰嶇疆 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Configuration |
| | |
| | | RedisTemplate<Object, Object> template = new RedisTemplate<>(); |
| | | template.setConnectionFactory(connectionFactory); |
| | | |
| | | FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class); |
| | | Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer(Object.class); |
| | | |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |