add default implement for isDeleted()

This commit is contained in:
Timi
2025-11-21 14:37:55 +08:00
parent 17b20f38e6
commit 113af72208

View File

@ -1,5 +1,7 @@
package com.imyeyu.spring.entity;
import com.imyeyu.utils.Time;
/**
* 可软删除实体
*
@ -27,5 +29,7 @@ public interface Deletable {
*
* @return true 为已删除
*/
boolean isDeleted();
default boolean isDeleted() {
return getDeletedAt() != null && getDeletedAt() < Time.now();
}
}