Browse Source

固定字段填充

master
WendyYang 1 year ago
parent
commit
3bfe10c772
2 changed files with 11 additions and 0 deletions
  1. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/BaseEntity.java
  2. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Menu.java

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/BaseEntity.java View File

@@ -1,5 +1,7 @@
package com.ningdatech.pmapi.sys.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@@ -20,15 +22,19 @@ import java.time.LocalDateTime;
public class BaseEntity implements Serializable {

@ApiModelProperty("创建人userId")
@TableField(fill = FieldFill.INSERT)
protected Long createBy;

@ApiModelProperty("最后修改人userId")
@TableField(fill = FieldFill.INSERT_UPDATE)
protected Long updateBy;

@ApiModelProperty("创建时间")
@TableField(fill = FieldFill.INSERT)
protected LocalDateTime createOn;

@ApiModelProperty("修改时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
protected LocalDateTime updateOn;

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Menu.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.sys.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity;
@@ -62,12 +63,16 @@ public class Menu extends MenuTreeEntity<Menu, Long> {
@ApiModelProperty("数据权限选项")
private String dataScopeOption;

@TableField(fill = FieldFill.INSERT_UPDATE)
private Long updateBy;

@TableField(fill = FieldFill.INSERT)
private Long createBy;

@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateOn;

@TableField(fill = FieldFill.INSERT)
private LocalDateTime createOn;

}

Loading…
Cancel
Save