From c32b0eee563e721420b9649b8ab76299b8718c71 Mon Sep 17 00:00:00 2001 From: gxwebsoft <170083662@qq.com> Date: Sun, 14 Dec 2025 08:40:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(system):=20=E6=B7=BB=E5=8A=A0=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=AD=97=E6=AE=B5=E7=9A=84JSON=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在TenantPackage实体类的createTime和updateTime字段上添加@JsonFormat注解 - 在TenantSubscription实体类的startTime、endTime、createTime和updateTime字段上添加@JsonFormat注解 - 在TenantSubscriptionOrder实体类的startTime、endTime、paymentTime、createTime和updateTime字段上添加@JsonFormat注解 - 所有日期字段均设置pattern为"yyyy-MM-dd HH:mm:ss",timezone为"GMT+8" - 统一实体类日期序列化格式,提升前后端数据交互一致性 --- .../com/gxwebsoft/common/system/entity/TenantPackage.java | 3 +++ .../gxwebsoft/common/system/entity/TenantSubscription.java | 5 +++++ .../common/system/entity/TenantSubscriptionOrder.java | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/src/main/java/com/gxwebsoft/common/system/entity/TenantPackage.java b/src/main/java/com/gxwebsoft/common/system/entity/TenantPackage.java index 3aa1f5c..25d5e36 100644 --- a/src/main/java/com/gxwebsoft/common/system/entity/TenantPackage.java +++ b/src/main/java/com/gxwebsoft/common/system/entity/TenantPackage.java @@ -1,6 +1,7 @@ package com.gxwebsoft.common.system.entity; import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -66,8 +67,10 @@ public class TenantPackage implements Serializable { private Integer sortNumber; @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; } diff --git a/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscription.java b/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscription.java index 4ef6c3b..028624a 100644 --- a/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscription.java +++ b/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscription.java @@ -1,6 +1,7 @@ package com.gxwebsoft.common.system.entity; import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -35,9 +36,11 @@ public class TenantSubscription implements Serializable { private Integer version; @Schema(description = "开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date startTime; @Schema(description = "到期时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date endTime; @Schema(description = "是否试用期") @@ -59,9 +62,11 @@ public class TenantSubscription implements Serializable { private Integer status; @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; // 关联查询字段 diff --git a/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscriptionOrder.java b/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscriptionOrder.java index f92f56e..37dcd25 100644 --- a/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscriptionOrder.java +++ b/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscriptionOrder.java @@ -1,6 +1,7 @@ package com.gxwebsoft.common.system.entity; import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -54,9 +55,11 @@ public class TenantSubscriptionOrder implements Serializable { private BigDecimal actualPrice; @Schema(description = "开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date startTime; @Schema(description = "到期时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date endTime; @Schema(description = "是否试用 0否 1是") @@ -78,6 +81,7 @@ public class TenantSubscriptionOrder implements Serializable { private String paymentId; @Schema(description = "支付时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date paymentTime; @Schema(description = "订单状态 0待支付 1已支付 2已激活 3已取消 4已退款") @@ -90,8 +94,10 @@ public class TenantSubscriptionOrder implements Serializable { private Integer userId; @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; }