重构知识库相关接口,更新数据结构和命名,移除示例文件,调整组件和视图以支持新命名,优化文档和数据集管理功能。

This commit is contained in:
2026-03-30 17:35:05 +08:00
parent 891f8ed776
commit d9b4a012ee
22 changed files with 1783 additions and 1115 deletions

111
src/api/cid/apis/index.ts Normal file
View File

@@ -0,0 +1,111 @@
import { newService } from '/@/utils/request';
// 接口查询参数
export interface ApiInterfaceQueryParams {
keyword?: string;
platformId?: string;
status?: string;
method?: string;
pageNum: number;
pageSize: number;
}
// 创建接口参数
export interface CreateApiInterfaceParams {
platformId: string | number;
name: string;
code: string;
url: string;
method: string;
status?: string;
authType?: string;
requestConfig?: Record<string, any>;
responseConfig?: Record<string, any>;
limitConfig?: Record<string, any>;
}
// 更新接口参数
export interface UpdateApiInterfaceParams extends Partial<CreateApiInterfaceParams> {
id: string;
}
// 更新接口状态参数
export interface UpdateApiInterfaceStatusParams {
id: string;
status: string;
}
// 接口信息(响应字段)
export interface ApiInterfaceInfo {
id: string;
platformId: string | number;
platformName?: string;
name: string;
code: string;
url: string;
method: string;
status: string;
statusName?: string;
authType?: string;
requestConfig?: Record<string, any>;
responseConfig?: Record<string, any>;
limitConfig?: Record<string, any>;
createdBy?: string;
createdAt?: number;
updatedBy?: string;
updatedAt?: number;
}
// 获取接口列表
export function listApiInterfaces(params: ApiInterfaceQueryParams) {
return newService({
url: '/api/interface/controller/listApiInterfaces',
method: 'get',
params,
});
}
// 获取接口详情
export function getApiInterface(id: string) {
return newService({
url: '/api/interface/controller/getApiInterface',
method: 'get',
params: { id },
});
}
// 创建接口
export function createApiInterface(data: CreateApiInterfaceParams) {
return newService({
url: '/api/interface/controller/createApiInterface',
method: 'post',
data,
});
}
// 修改接口
export function updateApiInterface(data: UpdateApiInterfaceParams) {
return newService({
url: '/api/interface/controller/updateApiInterface',
method: 'put',
data,
});
}
// 更新接口状态
export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
return newService({
url: '/api/interface/controller/updateApiInterfaceStatus',
method: 'put',
data,
});
}
// 删除接口
export function deleteApiInterface(id: string) {
return newService({
url: '/api/interface/controller/deleteApiInterface',
method: 'delete',
params: { id },
});
}