add default implement for isDeleted()
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user