From dc367677085d77fec95347956a62270b447c5f0f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 4 May 2025 16:01:06 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E3=80=90Gateway=20=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E3=80=91jackson=20=E9=92=88=E5=AF=B9=20fail-on-empty-?= =?UTF-8?q?beans=20=E7=AD=89=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-gateway/src/main/resources/application.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/yudao-gateway/src/main/resources/application.yaml b/yudao-gateway/src/main/resources/application.yaml index 0701013af..a03f08ba5 100644 --- a/yudao-gateway/src/main/resources/application.yaml +++ b/yudao-gateway/src/main/resources/application.yaml @@ -5,9 +5,16 @@ spring: profiles: active: local - # 调整缓冲区大小,解决报错 org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144 codec: - max-in-memory-size: 10MB + max-in-memory-size: 10MB # 调整缓冲区大小https://gitee.com/zhijiantianya/yudao-cloud/pulls/176 + + # Jackson 配置项 + jackson: + serialization: + write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳 + write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401 + write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳 + fail-on-empty-beans: false # 允许序列化无属性的 Bean main: allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。