Commit a6b1eb13 by huangjy

通用字段调整

parent b036ac30
...@@ -35,7 +35,7 @@ public class BaseEntity implements Serializable { ...@@ -35,7 +35,7 @@ public class BaseEntity implements Serializable {
* 创建时间 * 创建时间
*/ */
@ApiModelProperty(value = "创建时间", required = false) @ApiModelProperty(value = "创建时间", required = false)
@TableField(value = "created_at", fill = FieldFill.INSERT, typeHandler = LocalDateTimeTypeHandler.class) @TableField(value = "create_date", fill = FieldFill.INSERT, typeHandler = LocalDateTimeTypeHandler.class)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt; private LocalDateTime createdAt;
...@@ -43,18 +43,10 @@ public class BaseEntity implements Serializable { ...@@ -43,18 +43,10 @@ public class BaseEntity implements Serializable {
* 更新时间 * 更新时间
*/ */
@ApiModelProperty(value = "更新时间", required = false) @ApiModelProperty(value = "更新时间", required = false)
@TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE, typeHandler = LocalDateTimeTypeHandler.class) @TableField(value = "update_date", fill = FieldFill.INSERT_UPDATE, typeHandler = LocalDateTimeTypeHandler.class)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updatedAt; private LocalDateTime updatedAt;
//
// /**
// * 删除时间(逻辑删除)
// */
// @TableLogic(value="NULL",delval = "NOW()")
// @ApiModelProperty(value = "删除时间",required = false)
// @JsonFormat(pattern="yyyy-mm-dd HH:mm:ss")
// private LocalDateTime deletedAt;
@TableLogic @TableLogic
@TableField(select = false, fill = FieldFill.INSERT) @TableField(select = false, fill = FieldFill.INSERT)
...@@ -62,10 +54,10 @@ public class BaseEntity implements Serializable { ...@@ -62,10 +54,10 @@ public class BaseEntity implements Serializable {
@ApiModelProperty(value = "创建人名称") @ApiModelProperty(value = "创建人名称")
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
private String createdByName; private String createBy;
@ApiModelProperty(value = "更新人名称") @ApiModelProperty(value = "更新人名称")
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private String updatedByName; private String updateBy;
} }
...@@ -26,14 +26,14 @@ public class UserObjectHandler implements MetaObjectHandlerInternal { ...@@ -26,14 +26,14 @@ public class UserObjectHandler implements MetaObjectHandlerInternal {
// handler.setFieldValByName(BaseEntity.Fields.createdByName, commonUserVO.getName(), metaObject); // handler.setFieldValByName(BaseEntity.Fields.createdByName, commonUserVO.getName(), metaObject);
// } // }
if (metaObject.hasSetter(BaseEntity.Fields.createdByName)) { if (metaObject.hasSetter(BaseEntity.Fields.createBy)) {
if (!Boolean.TRUE.equals(NoFillUtil.getCreate())) { if (!Boolean.TRUE.equals(NoFillUtil.getCreate())) {
handler.setFieldValByName(BaseEntity.Fields.createdByName, commonUserVO.getName(), metaObject); handler.setFieldValByName(BaseEntity.Fields.createBy, commonUserVO.getName(), metaObject);
} }
} }
if (metaObject.hasSetter(BaseEntity.Fields.updatedByName)) { if (metaObject.hasSetter(BaseEntity.Fields.updateBy)) {
handler.setFieldValByName(BaseEntity.Fields.updatedByName, commonUserVO.getName(), metaObject); handler.setFieldValByName(BaseEntity.Fields.updateBy, commonUserVO.getName(), metaObject);
} }
if (metaObject.hasSetter("createdById")) { if (metaObject.hasSetter("createdById")) {
...@@ -50,9 +50,9 @@ public class UserObjectHandler implements MetaObjectHandlerInternal { ...@@ -50,9 +50,9 @@ public class UserObjectHandler implements MetaObjectHandlerInternal {
CommonUserVO commonUserVO = CommonUserUtil.getUser(); CommonUserVO commonUserVO = CommonUserUtil.getUser();
if (metaObject.hasSetter(BaseEntity.Fields.updatedByName)) { if (metaObject.hasSetter(BaseEntity.Fields.updateBy)) {
if (!Boolean.TRUE.equals(NoFillUtil.getUpdate())) { if (!Boolean.TRUE.equals(NoFillUtil.getUpdate())) {
handler.setFieldValByName(BaseEntity.Fields.updatedByName, commonUserVO.getName(), metaObject);; handler.setFieldValByName(BaseEntity.Fields.updateBy, commonUserVO.getName(), metaObject);;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment