|
@@ -4,6 +4,7 @@ import static org.springframework.data.redis.serializer.RedisSerializationContex
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
|
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
|
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
|
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
|
|
|
+import com.fasterxml.jackson.databind.MapperFeature;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
|
import org.jeecg.common.modules.redis.config.RedisConfig;
|
|
import org.jeecg.common.modules.redis.config.RedisConfig;
|
|
@@ -65,6 +66,7 @@ public class CacheConfig {
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
|
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
|
objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
|
|
objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
|
|
|
|
+ objectMapper.configure(MapperFeature.USE_ANNOTATIONS, false); // 忽略@JsonIgnore注解,缓存所有字段
|
|
|
|
|
|
// 配置缓存默认TTL,以及键值序列化方式 - 解决乱码的问题
|
|
// 配置缓存默认TTL,以及键值序列化方式 - 解决乱码的问题
|
|
RedisCacheConfiguration cacheConfiguration =
|
|
RedisCacheConfiguration cacheConfiguration =
|