mirror of
https://github.moeyy.xyz/https://github.com/GeWuYou/forgeboot
synced 2025-10-27 16:14:32 +08:00
refactor(spec-jpa): 重命名 isSoftDeleted 方法以提升代码可读性
- 将抽象方法 isSoftDeleted(entity: Entity) 重命名为 isSoftDeletedByEntity(entity: Entity) - 更新了相关文档注释,保持代码清晰易懂
This commit is contained in:
parent
307908b923
commit
8ffd18961f
@ -209,7 +209,7 @@ abstract class JpaCrudServiceImplSpec<Entity : Any, Id : Any>(
|
||||
* @param entity 实体对象,用于检查其删除状态
|
||||
* @return 如果实体已被标记为软删除状态返回 true,否则返回 false
|
||||
*/
|
||||
protected abstract fun isSoftDeleted(entity: Entity): Boolean
|
||||
protected abstract fun isSoftDeletedByEntity(entity: Entity): Boolean
|
||||
|
||||
/**
|
||||
* 执行软删除操作。
|
||||
@ -282,6 +282,6 @@ abstract class JpaCrudServiceImplSpec<Entity : Any, Id : Any>(
|
||||
*/
|
||||
override fun isSoftDeleted(id: Id): Boolean {
|
||||
val entity = findById(id)?:return false
|
||||
return isSoftDeleted(entity)
|
||||
return isSoftDeletedByEntity(entity)
|
||||
}
|
||||
}
|
||||
@ -41,7 +41,7 @@ abstract class SimpleJpaCrudServiceImplSpec<Entity : Any, Id : Any>(
|
||||
* @param entity 实体对象,用于检查其删除状态
|
||||
* @return 如果实体已被标记为软删除状态返回 true,否则返回 false
|
||||
*/
|
||||
override fun isSoftDeleted(entity: Entity): Boolean {
|
||||
override fun isSoftDeletedByEntity(entity: Entity): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user