parent
16ad0959f5
commit
2d8f4cab28
@ -0,0 +1,21 @@
|
|||||||
|
package com.xjs.common.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiejs
|
||||||
|
* @desc 天行数据配置
|
||||||
|
* @create 2021-12-27
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "tianxing.open")
|
||||||
|
@Data
|
||||||
|
public class TianXingProperties {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key密钥
|
||||||
|
*/
|
||||||
|
private String key;
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.xjs.common.handler;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.ibatis.reflection.MetaObject;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiejs
|
||||||
|
* @desc mp字段自动填充处理器
|
||||||
|
* @create 2021-12-27
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertFill(MetaObject metaObject) {
|
||||||
|
log.info("start insert fill ....");
|
||||||
|
//this.setFieldValByName("createTime", new Date(), metaObject);
|
||||||
|
this.strictInsertFill(metaObject, "createTime", Date.class,new Date()); // 起始版本 3.3.3(推荐)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFill(MetaObject metaObject) {
|
||||||
|
log.info("start update fill ....");
|
||||||
|
//this.strictInsertFill(metaObject, "updateTime", LocalDateTime::now, LocalDateTime.class); // 起始版本 3.3.3(推荐)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue