yshop3.0-alpha版本

This commit is contained in:
hupeng
2020-06-27 16:29:35 +08:00
parent 31189da79e
commit 761840d8f2
1153 changed files with 27921 additions and 33489 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>yshop</artifactId>
<groupId>co.yixiang</groupId>
<version>2.2</version>
<version>3.0-alpha</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>MyBatisPlus模块</name>

View File

@ -16,9 +16,11 @@ package co.yixiang.config;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.core.annotation.OrderUtils;
import org.springframework.stereotype.Component;
import java.sql.Timestamp;
import java.util.Date;
/**
* 处理新增和更新的基础数据填充配合BaseEntity和MyBatisPlusConfig使用
@ -57,6 +59,10 @@ public class MetaHandler implements MetaObjectHandler {
log.debug("自动插入 delFlag");
this.setFieldValByName("delFlag", false, metaObject);
}
if(metaObject.hasSetter("addTime")){
String timestamp = String.valueOf(new Date().getTime()/1000);
this.setFieldValByName("addTime", Integer.valueOf(timestamp), metaObject);
}
} catch (Exception e) {
log.error("自动注入失败:{}", e);
}