更新开发环境API服务地址至192.168.3.30,调整ESLint配置以忽略特定变量,添加数据集和文档相关的创建与更新接口,优化错误处理和用户反馈,移除模拟数据,增强代码可读性。
This commit is contained in:
@@ -10,6 +10,25 @@ export interface DocumentQueryParams {
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
// 创建文档参数
|
||||
export interface CreateDocumentParams {
|
||||
KnowledgeId: number; // 必传
|
||||
filePath: string; // 必传
|
||||
fileSize: number; // 必传
|
||||
format: string; // 必传
|
||||
title: string; // 必传
|
||||
}
|
||||
|
||||
// 更新文档参数
|
||||
export interface UpdateDocumentParams {
|
||||
id: string; // 必传
|
||||
KnowledgeId?: number; // 可选
|
||||
filePath?: string; // 可选
|
||||
fileSize?: number; // 可选
|
||||
format?: string; // 可选
|
||||
title?: string; // 可选
|
||||
}
|
||||
|
||||
// 文档信息
|
||||
export interface DocumentInfo {
|
||||
id?: string;
|
||||
@@ -58,6 +77,24 @@ export function getDocument(id: string) {
|
||||
});
|
||||
}
|
||||
|
||||
// 创建文档(JSON格式)
|
||||
export function createDocument(data: CreateDocumentParams) {
|
||||
return newService({
|
||||
url: '/knowledge/document/create',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新文档
|
||||
export function updateDocument(data: UpdateDocumentParams) {
|
||||
return newService({
|
||||
url: '/knowledge/document/update',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 上传文档
|
||||
export function uploadDocument(data: FormData) {
|
||||
return newService({
|
||||
|
||||
Reference in New Issue
Block a user