1、在service-base模块中添加
创建包handler,创建自动填充类 MyMetaObjectHandler
@Component public class MyMetaObjectHandler implements MetaObjectHandler { //自动填充 @Override public void insertFill(MetaObject metaObject) { this.setFieldValByName("gmtCreate",new Date(),metaObject); this.setFieldValByName("gmtModified",new Date(),metaObject); } @Override public void updateFill(MetaObject metaObject) { this.setFieldValByName("gmtModified",new Date(),metaObject); } }