upload project source code

This commit is contained in:
2026-04-30 18:49:43 +08:00
commit 9b394ba682
2277 changed files with 660945 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
import { l as httpRequest } from "./index.CMd5bD1r.js";
const API_PATH = "/application/ai/knowledge";
const KnowledgeBaseAPI = {
// 列表查询
list(query) {
return httpRequest({
url: `${API_PATH}/list`,
method: "get",
params: query
});
},
// 详情查询
detail(id) {
return httpRequest({
url: `${API_PATH}/detail/${id}`,
method: "get"
});
},
// 新增(支持文件上传)
create(body, files) {
const formData = new FormData();
if (body.name) formData.append("name", body.name);
if (body.embedding_config_id) formData.append("embedding_config_id", String(body.embedding_config_id));
if (body.description) formData.append("description", body.description);
if (files && files.length > 0) {
files.forEach((file) => {
formData.append("files", file);
});
}
return httpRequest({
url: `${API_PATH}/create`,
method: "post",
data: formData,
headers: {
"Content-Type": "multipart/form-data"
}
});
},
// 修改
update(id, body) {
return httpRequest({
url: `${API_PATH}/update/${id}`,
method: "put",
data: body
});
},
// 删除
delete(ids) {
return httpRequest({
url: `${API_PATH}/delete`,
method: "delete",
data: ids
});
},
// 重试向量化
retry(id) {
return httpRequest({
url: `${API_PATH}/retry/${id}`,
method: "post"
});
}
};
const KB_STATUS_MAP = {
0: { label: "待处理", type: "info" },
1: { label: "处理中", type: "warning" },
2: { label: "已完成", type: "success" },
3: { label: "处理失败", type: "danger" }
};
export {
KnowledgeBaseAPI as K,
KB_STATUS_MAP as a
};