From 3dc35915a74fb5e6042981f73830e88f45179b63 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期六, 18 四月 2026 18:38:40 +0800
Subject: [PATCH] [feat] position消息处理
---
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/config/MessageLocalConfig.java | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/config/MessageLocalConfig.java b/xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/config/MessageLocalConfig.java
index ac43972..daeaa8d 100644
--- a/xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/config/MessageLocalConfig.java
+++ b/xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/config/MessageLocalConfig.java
@@ -1,13 +1,14 @@
package com.xiaopeng.pushMessage.config;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.boot.autoconfigure.context.MessageSourceProperties;
-import org.springframework.boot.autoconfigure.web.WebProperties;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.util.StringUtils;
-import org.springframework.web.servlet.LocaleResolver;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
@@ -59,4 +60,13 @@
// return new MyLocaleResolver();
// }
+ @Bean
+ ObjectMapper om() {
+ // 允许对象忽略json中不存在的属性
+ ObjectMapper om = new ObjectMapper();
+ om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ om.registerModule(new JavaTimeModule());
+ return om;
+ }
+
}
--
Gitblit v1.7.1