From b444f72d9ed6ea64f7158e9334cc78c8653b7393 Mon Sep 17 00:00:00 2001 From: mazhicheng Date: Mon, 8 Jun 2020 20:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=85=A8=E5=B1=80=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=A0=BC=E5=BC=8F=E9=85=8D=E7=BD=AE=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96Date=E7=B1=BB=E5=9E=8B=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/diboot/core/starter/CoreAutoConfiguration.java | 1 - .../src/main/java/com/diboot/core/entity/BaseEntity.java | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/diboot-core-starter/src/main/java/com/diboot/core/starter/CoreAutoConfiguration.java b/diboot-core-starter/src/main/java/com/diboot/core/starter/CoreAutoConfiguration.java index 0ed7015..6851881 100644 --- a/diboot-core-starter/src/main/java/com/diboot/core/starter/CoreAutoConfiguration.java +++ b/diboot-core-starter/src/main/java/com/diboot/core/starter/CoreAutoConfiguration.java @@ -82,7 +82,6 @@ public class CoreAutoConfiguration{ // 设置fastjson的序列化参数:禁用循环依赖检测,数据兼容浏览器端(避免JS端Long精度丢失问题) fastJsonConfig.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect, SerializerFeature.BrowserCompatible); - fastJsonConfig.setDateFormat(D.FORMAT_DATETIME_Y4MDHM); converter.setFastJsonConfig(fastJsonConfig); HttpMessageConverter httpMsgConverter = converter; diff --git a/diboot-core/src/main/java/com/diboot/core/entity/BaseEntity.java b/diboot-core/src/main/java/com/diboot/core/entity/BaseEntity.java index 4b12a14..8a3fa65 100644 --- a/diboot-core/src/main/java/com/diboot/core/entity/BaseEntity.java +++ b/diboot-core/src/main/java/com/diboot/core/entity/BaseEntity.java @@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.annotation.*; import com.diboot.core.config.Cons; import com.diboot.core.util.BeanUtils; import com.diboot.core.util.ContextHelper; +import com.diboot.core.util.D; import com.diboot.core.util.JSON; import lombok.Getter; import lombok.Setter; @@ -41,13 +42,13 @@ import java.util.Map; public abstract class BaseEntity implements Serializable { private static final long serialVersionUID = 10203L; - /*** + /** * 默认主键字段id,类型为Long型自增,转json时转换为String */ @TableId(type = IdType.AUTO) private Long id; - /*** + /** * 默认逻辑删除标记,is_deleted=0有效 */ @TableLogic @@ -55,9 +56,10 @@ public abstract class BaseEntity implements Serializable { @TableField(Cons.COLUMN_IS_DELETED) private boolean deleted = false; - /*** + /** * 默认记录创建时间字段,新建时由数据库赋值 */ + @JSONField(format = D.FORMAT_DATETIME_Y4MDHMS) @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER) private Date createTime;