package com.imyeyu.spring.entity; import com.imyeyu.spring.annotation.table.DeleteColumn; import com.imyeyu.utils.Time; import lombok.Data; import java.io.Serializable; /** * 基本实体 * * @author 夜雨 * @version 2021-11-20 17:45 */ @Data public class BaseEntity implements Serializable, Creatable, Updatable, Deletable { /** 创建时间 */ protected Long createdAt; /** 更新时间 */ protected Long updatedAt; /** 删除时间 */ @DeleteColumn protected Long deletedAt; @Override public boolean isDeleted() { return deletedAt != null && deletedAt < Time.now(); } }