From 8ffd18961f1540eb568af21db076766c949c9d33 Mon Sep 17 00:00:00 2001 From: gewuyou Date: Fri, 25 Jul 2025 14:32:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor(spec-jpa):=20=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=20isSoftDeleted=20=E6=96=B9=E6=B3=95=E4=BB=A5?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E4=BB=A3=E7=A0=81=E5=8F=AF=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将抽象方法 isSoftDeleted(entity: Entity) 重命名为 isSoftDeletedByEntity(entity: Entity) - 更新了相关文档注释,保持代码清晰易懂 --- .../webmvc/spec/jpa/service/impl/JpaCrudServiceImplSpec.kt | 4 ++-- .../spec/jpa/service/impl/SimpleJpaCrudServiceImplSpec.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/forgeboot-webmvc/spec-jpa/src/main/kotlin/com/gewuyou/webmvc/spec/jpa/service/impl/JpaCrudServiceImplSpec.kt b/forgeboot-webmvc/spec-jpa/src/main/kotlin/com/gewuyou/webmvc/spec/jpa/service/impl/JpaCrudServiceImplSpec.kt index 5aa4d6e..9cc9c75 100644 --- a/forgeboot-webmvc/spec-jpa/src/main/kotlin/com/gewuyou/webmvc/spec/jpa/service/impl/JpaCrudServiceImplSpec.kt +++ b/forgeboot-webmvc/spec-jpa/src/main/kotlin/com/gewuyou/webmvc/spec/jpa/service/impl/JpaCrudServiceImplSpec.kt @@ -209,7 +209,7 @@ abstract class JpaCrudServiceImplSpec( * @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( */ override fun isSoftDeleted(id: Id): Boolean { val entity = findById(id)?:return false - return isSoftDeleted(entity) + return isSoftDeletedByEntity(entity) } } \ No newline at end of file diff --git a/forgeboot-webmvc/spec-jpa/src/main/kotlin/com/gewuyou/webmvc/spec/jpa/service/impl/SimpleJpaCrudServiceImplSpec.kt b/forgeboot-webmvc/spec-jpa/src/main/kotlin/com/gewuyou/webmvc/spec/jpa/service/impl/SimpleJpaCrudServiceImplSpec.kt index 4206237..2973ee0 100644 --- a/forgeboot-webmvc/spec-jpa/src/main/kotlin/com/gewuyou/webmvc/spec/jpa/service/impl/SimpleJpaCrudServiceImplSpec.kt +++ b/forgeboot-webmvc/spec-jpa/src/main/kotlin/com/gewuyou/webmvc/spec/jpa/service/impl/SimpleJpaCrudServiceImplSpec.kt @@ -41,7 +41,7 @@ abstract class SimpleJpaCrudServiceImplSpec( * @param entity 实体对象,用于检查其删除状态 * @return 如果实体已被标记为软删除状态返回 true,否则返回 false */ - override fun isSoftDeleted(entity: Entity): Boolean { + override fun isSoftDeletedByEntity(entity: Entity): Boolean { return false } } \ No newline at end of file