From 2fee49f5157cc31b4847128405f69034073a5756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Sun, 3 Jul 2022 00:02:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=9B=E5=BB=BA/=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5=E5=90=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/mybatis/handler/MyMetaObjectHandler.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/youlai-common/common-mybatis/src/main/java/com/youlai/common/mybatis/handler/MyMetaObjectHandler.java b/youlai-common/common-mybatis/src/main/java/com/youlai/common/mybatis/handler/MyMetaObjectHandler.java index a34bad70b..3d082e3b9 100644 --- a/youlai-common/common-mybatis/src/main/java/com/youlai/common/mybatis/handler/MyMetaObjectHandler.java +++ b/youlai-common/common-mybatis/src/main/java/com/youlai/common/mybatis/handler/MyMetaObjectHandler.java @@ -7,8 +7,10 @@ import org.springframework.stereotype.Component; import java.time.LocalDateTime; /** - * 字段自动填充 + * mybatis-plus 字段自动填充 * + * @author haoxr + * @date 2022/7/3 * @link https://mp.baomidou.com/guide/auto-fill-metainfo.html */ @Component @@ -21,8 +23,8 @@ public class MyMetaObjectHandler implements MetaObjectHandler { */ @Override public void insertFill(MetaObject metaObject) { - this.strictInsertFill(metaObject, "gmtCreate", () -> LocalDateTime.now(), LocalDateTime.class); - this.strictUpdateFill(metaObject, "gmtModified", () -> LocalDateTime.now(), LocalDateTime.class); + this.strictInsertFill(metaObject, "createTime", () -> LocalDateTime.now(), LocalDateTime.class); + this.strictUpdateFill(metaObject, "updateTime", () -> LocalDateTime.now(), LocalDateTime.class); } /** @@ -32,7 +34,7 @@ public class MyMetaObjectHandler implements MetaObjectHandler { */ @Override public void updateFill(MetaObject metaObject) { - this.strictUpdateFill(metaObject, "gmtModified", () -> LocalDateTime.now(), LocalDateTime.class); + this.strictUpdateFill(metaObject, "updateTime", () -> LocalDateTime.now(), LocalDateTime.class); } }