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