From 3cc5256ecb6f34d0bfe0e13903f8a87cf5fcce91 Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期五, 28 六月 2024 11:15:56 +0800
Subject: [PATCH] 花城 需求清单列表新增显示隐藏字段 新增认领人数字段  新增时间段筛选功能

---
 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/redis/CacheConfig.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/redis/CacheConfig.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/redis/CacheConfig.java
index 0b8f8b3..e449b75 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/redis/CacheConfig.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/redis/CacheConfig.java
@@ -2,6 +2,7 @@
 
 import java.time.Duration;
 
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
 import org.springframework.cache.CacheManager;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -38,7 +39,12 @@
 
         ObjectMapper objectMapper = new ObjectMapper();
         objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
-        objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+//        objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+
+        objectMapper.activateDefaultTyping(
+                objectMapper.getPolymorphicTypeValidator(),
+                ObjectMapper.DefaultTyping.NON_FINAL,
+                JsonTypeInfo.As.PROPERTY);
 
         jackson2JsonRedisSerializer.setObjectMapper(objectMapper);
 

--
Gitblit v1.7.1