修复上传返回报错问题
This commit is contained in:
@@ -61,9 +61,9 @@ public interface KnowledgeBaseService {
|
||||
List<String> uploadDocuments(String kbId, MultipartFile[] files);
|
||||
|
||||
/**
|
||||
* 知识库追加导入已解析的文档
|
||||
* 知识库追加导入已解析的文档(异步)
|
||||
*/
|
||||
boolean submitDocuments(String kbId, String fileId);
|
||||
void submitDocuments(String kbId, String fileId);
|
||||
|
||||
/**
|
||||
* 知识库追加导入已解析的文档
|
||||
|
||||
@@ -193,12 +193,11 @@ public class KnowledgeBaseServiceImpl implements KnowledgeBaseService {
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public boolean submitDocuments(String kbId, String fileId) {
|
||||
public void submitDocuments(String kbId, String fileId) {
|
||||
String workspaceId = config.getWorkspaceId();
|
||||
try {
|
||||
Client client = clientFactory.createClient();
|
||||
boolean result = AiCloudKnowledgeBaseUtil.submitIndexAddDocumentsJob(client, workspaceId, kbId, fileId).getBody().getSuccess();
|
||||
return result;
|
||||
AiCloudKnowledgeBaseUtil.submitIndexAddDocumentsJob(client, workspaceId, kbId, fileId).getBody().getSuccess();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("添加文档到知识库失败: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user