From 1f19230e00b543b58f03853df1a38ebd8b508e55 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期五, 21 二月 2025 16:55:01 +0800
Subject: [PATCH] 发布灌溉计划并生成开阀计划
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java
index 22eb799..e57c5dc 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java
@@ -6,18 +6,21 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
-//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
+/**
+ * 蹇呴』瀹炵幇WebMvcConfigurer鍚﹀垯涓嶅惎浣滅敤锛屽嵆Controller杞琷son鏃朵笉鐢╢astjson
+ */
@Configuration
-public class FastJsonConfig {
+public class FastJsonConfig implements WebMvcConfigurer {
/**
* 閰嶇疆fastjson杈撳嚭鏍煎紡
**/
- @SuppressWarnings("unused")
+ @Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
// 1. 閰嶇疆fastjson
com.alibaba.fastjson2.support.config.FastJsonConfig config = new com.alibaba.fastjson2.support.config.FastJsonConfig();
@@ -29,12 +32,12 @@
JSONWriter.Feature.WriteMapNullValue,
//杈撳嚭null鐨刡oolean 涓� false
JSONWriter.Feature.WriteNullBooleanAsFalse,
- //鎶奓ong鍨嬭緭鍑轰负String
+ //鎶奓ong鍨嬭緭鍑轰负String锛屽湪pojo鐨勫睘鎬т腑涓�ц缃�
//JSONWriter.Feature.WriteLongAsString,
//杈撳嚭null鐨刲ist 涓� []
JSONWriter.Feature.WriteNullListAsEmpty,
//杈撳嚭null鐨刵umber 涓� 0
- JSONWriter.Feature.WriteNullNumberAsZero,
+ //JSONWriter.Feature.WriteNullNumberAsZero,
//杈撳嚭null瀛楃涓� 涓� ""
JSONWriter.Feature.WriteNullStringAsEmpty,
//瀵筸ap杩涜鎺掑簭
--
Gitblit v1.8.0