Commit 848f60a3 by pengshun

修改知识库大小限制在个人知识库

parent 2a8229c8
......@@ -71,7 +71,7 @@ public class AiKnowledgeDocumentServiceImpl implements AiKnowledgeDocumentServic
throw exception(KNOWLEDGE_REPEAT_FILE);
}
// 1. 校验参数
knowledgeService.validateKnowledgeExists(createReqVO.getKnowledgeId());
AiKnowledgeDO knowledge = knowledgeService.validateKnowledgeExists(createReqVO.getKnowledgeId());
String content = createReqVO.getContent();
Integer cotentLength = null;
if(!Objects.equals(createReqVO.getUrl(), "") && createReqVO.getUrl() != null){
......@@ -80,7 +80,7 @@ public class AiKnowledgeDocumentServiceImpl implements AiKnowledgeDocumentServic
AdminUserDO user = userService.getUser(getLoginUserId());
long usedSize = getKnowledgeSize(user.getId()) + cotentLength;
if(usedSize > user.getKbSize()){
if(usedSize > user.getKbSize() && Objects.equals(knowledge.getEmbeddingModel(), "owner_kb")){
throw exception(KNOWLEDGE_NO_SPACE);
}
}
......
......@@ -151,7 +151,7 @@ public class FileController {
// 1. 使用第三方库读取 .doc 数据流 (此处以 Spire.Doc 为例)
// com.spire.doc.Document document = new com.spire.doc.Document();
Document document = new Document();
document.loadFromStream(is, com.spire.doc.FileFormat.Doc);
document.loadFromStream(is, com.spire.doc.FileFormat.Auto);
// 2. 将数据流保存为 .docx 格式到内存输出流
// FileFormat.Docx_2013 是较稳定的兼容格式
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment