移除全局日期格式配置,优化Date类型格式

This commit is contained in:
mazhicheng 2020-06-08 20:32:42 +08:00
parent 1b43406d2d
commit b444f72d9e
2 changed files with 5 additions and 4 deletions

View File

@ -82,7 +82,6 @@ public class CoreAutoConfiguration{
// 设置fastjson的序列化参数禁用循环依赖检测数据兼容浏览器端避免JS端Long精度丢失问题 // 设置fastjson的序列化参数禁用循环依赖检测数据兼容浏览器端避免JS端Long精度丢失问题
fastJsonConfig.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect, fastJsonConfig.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect,
SerializerFeature.BrowserCompatible); SerializerFeature.BrowserCompatible);
fastJsonConfig.setDateFormat(D.FORMAT_DATETIME_Y4MDHM);
converter.setFastJsonConfig(fastJsonConfig); converter.setFastJsonConfig(fastJsonConfig);
HttpMessageConverter<?> httpMsgConverter = converter; HttpMessageConverter<?> httpMsgConverter = converter;

View File

@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.annotation.*;
import com.diboot.core.config.Cons; import com.diboot.core.config.Cons;
import com.diboot.core.util.BeanUtils; import com.diboot.core.util.BeanUtils;
import com.diboot.core.util.ContextHelper; import com.diboot.core.util.ContextHelper;
import com.diboot.core.util.D;
import com.diboot.core.util.JSON; import com.diboot.core.util.JSON;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -41,13 +42,13 @@ import java.util.Map;
public abstract class BaseEntity implements Serializable { public abstract class BaseEntity implements Serializable {
private static final long serialVersionUID = 10203L; private static final long serialVersionUID = 10203L;
/*** /**
* 默认主键字段id类型为Long型自增转json时转换为String * 默认主键字段id类型为Long型自增转json时转换为String
*/ */
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
private Long id; private Long id;
/*** /**
* 默认逻辑删除标记is_deleted=0有效 * 默认逻辑删除标记is_deleted=0有效
*/ */
@TableLogic @TableLogic
@ -55,9 +56,10 @@ public abstract class BaseEntity implements Serializable {
@TableField(Cons.COLUMN_IS_DELETED) @TableField(Cons.COLUMN_IS_DELETED)
private boolean deleted = false; private boolean deleted = false;
/*** /**
* 默认记录创建时间字段新建时由数据库赋值 * 默认记录创建时间字段新建时由数据库赋值
*/ */
@JSONField(format = D.FORMAT_DATETIME_Y4MDHMS)
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER) @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
private Date createTime; private Date createTime;