diff --git a/src/main/java/com/example/demo/common/domain/BaseEntity.java b/src/main/java/com/example/demo/common/domain/BaseEntity.java index 9589305..d306d2c 100644 --- a/src/main/java/com/example/demo/common/domain/BaseEntity.java +++ b/src/main/java/com/example/demo/common/domain/BaseEntity.java @@ -1,5 +1,6 @@ package com.example.demo.common.domain; +import com.example.demo.common.config.orm.handler.SqliteDateTypeHandler; import com.example.demo.common.config.orm.listener.FlexListener; import com.mybatisflex.annotation.Column; import com.mybatisflex.annotation.Id; @@ -33,7 +34,7 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor @Table( - value = "", + value = "demo", comment = "基本类没有对应的表!", onInsert = FlexListener.class, onUpdate = FlexListener.class, @@ -85,7 +86,7 @@ public class BaseEntity implements Serializable { * Column(onInsertValue = "CURRENT_TIMESTAMP") * Column(onInsertValue = "datetime('now', 'localtime')") */ -// @Column(onInsertValue = "datetime('now', 'localtime')") + @Column(typeHandler = SqliteDateTypeHandler.class) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @Schema(description = "创建时间") @@ -105,7 +106,7 @@ public class BaseEntity implements Serializable { * Column(onUpdateValue = "CURRENT_TIMESTAMP", onInsertValue = "CURRENT_TIMESTAMP") * Column(onUpdateValue = "datetime('now', 'localtime')", onInsertValue = "datetime('now', 'localtime')") */ -// @Column(onUpdateValue = "datetime('now', 'localtime')", onInsertValue = "datetime('now', 'localtime')") + @Column(typeHandler = SqliteDateTypeHandler.class) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @Schema(description = "更新时间")