This commit is contained in:
2025-07-29 13:47:57 +08:00
parent fe24c563a0
commit 91867300ed

View File

@@ -28,6 +28,10 @@ public class JacksonUtil {
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
objectMapper.setTimeZone(TimeZone.getTimeZone(ZoneId.of("Asia/Shanghai"))); objectMapper.setTimeZone(TimeZone.getTimeZone(ZoneId.of("Asia/Shanghai")));
objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
objectMapper.configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false);
objectMapper.configure(SerializationFeature.WRITE_SELF_REFERENCES_AS_NULL, true);
objectMapper.configure(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY, false);
} }
/** /**