add lombok
This commit is contained in:
@@ -2,6 +2,7 @@ package com.imyeyu.spring.entity;
|
||||
|
||||
import com.imyeyu.spring.annotation.table.DeleteColumn;
|
||||
import com.imyeyu.utils.Time;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -11,14 +12,9 @@ import java.io.Serializable;
|
||||
* @author 夜雨
|
||||
* @version 2021-11-20 17:45
|
||||
*/
|
||||
@Data
|
||||
public class BaseEntity implements Serializable, Creatable, Updatable, Deletable {
|
||||
|
||||
/**
|
||||
* 创建基础实体
|
||||
*/
|
||||
public BaseEntity() {
|
||||
}
|
||||
|
||||
/** 创建时间 */
|
||||
protected Long createdAt;
|
||||
|
||||
@@ -29,60 +25,6 @@ public class BaseEntity implements Serializable, Creatable, Updatable, Deletable
|
||||
@DeleteColumn
|
||||
protected Long deletedAt;
|
||||
|
||||
/**
|
||||
* 获取创建时间
|
||||
*
|
||||
* @return 创建时间
|
||||
*/
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置创建时间
|
||||
*
|
||||
* @param createdAt 创建时间
|
||||
*/
|
||||
public void setCreatedAt(Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取更新时间
|
||||
*
|
||||
* @return 更新时间
|
||||
*/
|
||||
public Long getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置更新时间
|
||||
*
|
||||
* @param updatedAt 更新时间
|
||||
*/
|
||||
public void setUpdatedAt(Long updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取删除时间
|
||||
*
|
||||
* @return 删除时间
|
||||
*/
|
||||
public Long getDeletedAt() {
|
||||
return deletedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置删除时间
|
||||
*
|
||||
* @param deletedAt 删除时间
|
||||
*/
|
||||
public void setDeletedAt(Long deletedAt) {
|
||||
this.deletedAt = deletedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return deletedAt != null && deletedAt < Time.now();
|
||||
|
||||
Reference in New Issue
Block a user