com.midcu.common.entity.BaseEntity Maven / Gradle / Ivy
The newest version!
package com.midcu.common.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.Null;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.time.LocalDateTime;
@Setter
@Getter
public class BaseEntity implements Serializable {
// private static final long serialVersionUID = 1L;
@TableField(value = "create_time", fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Null(message = "创建时间必须为空!")
private LocalDateTime createTime;
@TableField(value = "create_user", fill = FieldFill.INSERT)
@Null(message = "创建人必须为空!")
private String createUser;
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Null(message = "更新时间必须为空!")
private LocalDateTime updateTime;
@TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
@Null(message = "更新人必须为空!")
private String updateUser;
}