From 0a2f2c1d709f848d215d0c7ce9d0dd3505fe3d13 Mon Sep 17 00:00:00 2001 From: moyangzhan Date: Mon, 19 Feb 2024 18:21:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=9F=A5=E8=AF=86=E5=BA=93=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/service/KnowledgeBaseService.java | 17 ++++++++++------- .../resources/mapper/KnowledgeBaseMapper.xml | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/adi-common/src/main/java/com/moyz/adi/common/service/KnowledgeBaseService.java b/adi-common/src/main/java/com/moyz/adi/common/service/KnowledgeBaseService.java index 6f3eacc..450b3c5 100644 --- a/adi-common/src/main/java/com/moyz/adi/common/service/KnowledgeBaseService.java +++ b/adi-common/src/main/java/com/moyz/adi/common/service/KnowledgeBaseService.java @@ -71,6 +71,7 @@ public class KnowledgeBaseService extends ServiceImpl result = new ArrayList<>(); KnowledgeBase knowledgeBase = ChainWrappers.lambdaQueryChain(baseMapper) .eq(KnowledgeBase::getUuid, kbUuid) @@ -162,8 +164,7 @@ public class KnowledgeBaseService extends ServiceImpl wrapper = new LambdaQueryWrapper(); wrapper.eq(KnowledgeBaseItem::getIsDeleted, false); wrapper.eq(KnowledgeBaseItem::getUuid, kbUuid); @@ -186,8 +187,7 @@ public class KnowledgeBaseService extends ServiceImpl new BaseException(A_DATA_NOT_FOUND)); } - private boolean checkPrivilege(Long kbId, String kbUuid) { + private void checkPrivilege(Long kbId, String kbUuid) { if (null == kbId && StringUtils.isBlank(kbUuid)) { throw new BaseException(A_PARAMS_ERROR); } @@ -235,7 +235,7 @@ public class KnowledgeBaseService extends ServiceImpl wrapper = new LambdaQueryWrapper(); wrapper.eq(KnowledgeBase::getOwnerId, user.getId()); @@ -244,6 +244,9 @@ public class KnowledgeBaseService extends ServiceImpl - nd (is_public = true or owner_id = #{ownerId}) + and (is_public = true or owner_id = #{ownerId}) and owner_id = #{ownerId}