master
xinzirun 2024-08-09 11:03:37 +08:00
parent 3687adcff6
commit a2886b1f43
1 changed files with 6 additions and 2 deletions

View File

@ -2,9 +2,8 @@ package com.muyu.common.datascope;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.security.utils.SecurityUtils;
import lombok.extern.log4j.Log4j2;
import org.apache.ibatis.reflection.MetaObject; import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
/** /**
@ -12,8 +11,13 @@ import java.util.Date;
* @Date 2024/8/9 10:44 * @Date 2024/8/9 10:44
* @Description * @Description
*/ */
@Log4j2
public class MyMetaObjectHandler implements MetaObjectHandler { public class MyMetaObjectHandler implements MetaObjectHandler {
public MyMetaObjectHandler() {
log.info("元对象字段填充控制器抽象类 ------ 加载完成");
}
@Override @Override
public void insertFill(MetaObject metaObject) { public void insertFill(MetaObject metaObject) {
this.setFieldValByName("createBy", SecurityUtils.getUserId(), metaObject); this.setFieldValByName("createBy", SecurityUtils.getUserId(), metaObject);