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}