mirror of https://github.com/longtai-cn/hippo4j
parent
8ab9ecd064
commit
e20f0fd92a
@ -0,0 +1,32 @@
|
||||
package io.dynamic.threadpool.server.config;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import io.dynamic.threadpool.server.enums.DelEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Meta Object Handler.
|
||||
*
|
||||
* @author chen.ma
|
||||
* @date 2021/7/1 22:43
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
this.strictInsertFill(metaObject, "gmtCreate", Date.class, new Date());
|
||||
this.strictInsertFill(metaObject, "gmtModified", Date.class, new Date());
|
||||
|
||||
this.strictInsertFill(metaObject, "delFlag", Integer.class, DelEnum.NORMAL.getIntCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
this.strictInsertFill(metaObject, "gmtModified", Date.class, new Date());
|
||||
}
|
||||
}
|
Loading…
Reference in new issue