Commit b03cdeb3 authored by zhouxudong's avatar zhouxudong

添加公共配置

parent c38b4a00
package com.lyy.user.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @Author:zhouxudong
* @version: 1.0
* @Date: 2023/11/23 16:57
* @Description:
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public abstract class BaseEntity extends Model implements Serializable {
@TableId
protected Long id;
@TableField(
value = "create_by",
fill = FieldFill.INSERT
)
protected String createBy;
@TableField(
value = "create_time",
fill = FieldFill.INSERT
)
protected LocalDateTime createTime;
@TableField(
value = "update_by",
fill = FieldFill.INSERT_UPDATE
)
protected String updateBy;
@TableField(
value = "update_time",
fill = FieldFill.INSERT_UPDATE
)
protected LocalDateTime updateTime;
@Version
@TableField(
value = "version",
fill = FieldFill.INSERT
)
protected Integer version;
public Serializable pkVal() {
return this.id;
}
}
package com.lyy.user.moudle.smslog.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.lyy.user.domain.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;
......@@ -21,9 +22,8 @@ import java.util.Date;
@NoArgsConstructor
@ToString
@Accessors(chain = true)
public class SysSmsLogEntity implements Serializable {
/** 主键id */
@TableId private Long id;
public class SysSmsLogEntity extends BaseEntity {
/** 返回标识符 */
private String code;
/** 返回字段描述 */
......@@ -34,20 +34,5 @@ public class SysSmsLogEntity implements Serializable {
private String type;
private String phone;
/** 乐观锁 */
@Version
@TableField(value = "version", fill = FieldFill.INSERT)
private Integer version;
/** 创建人 */
@TableField(value = "create_by", fill = FieldFill.INSERT)
private String createBy;
/** 创建时间 */
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
/** 更新人 */
@TableField(value = "update_by", fill = FieldFill.UPDATE)
private String updateBy;
/** 更新时间 */
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private LocalDateTime updateTime;
}
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 to comment