mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
38 lines
899 B
TypeScript
38 lines
899 B
TypeScript
import { request } from 'umi';
|
|
import { DimensionType, ModelType, PluginType } from './type';
|
|
|
|
export function savePlugin(params: Partial<PluginType>) {
|
|
return request<Result<any>>('/api/chat/plugin', {
|
|
method: params.id ? 'PUT' : 'POST',
|
|
data: params,
|
|
});
|
|
}
|
|
|
|
export function getPluginList(filters?: any) {
|
|
return request<Result<any[]>>('/api/chat/plugin/query', {
|
|
method: 'POST',
|
|
data: filters,
|
|
});
|
|
}
|
|
|
|
export function deletePlugin(id: number) {
|
|
return request<Result<any>>(`/api/chat/plugin/${id}`, {
|
|
method: 'DELETE',
|
|
});
|
|
}
|
|
|
|
export function getModelList() {
|
|
return request<Result<ModelType[]>>('/api/chat/conf/getDomainDataSetTree', {
|
|
method: 'GET',
|
|
});
|
|
}
|
|
|
|
export function getDataSetSchema(dataSetId: number) {
|
|
return request<Result<{ list: DimensionType[] }>>(
|
|
`/api/chat/conf/getDataSetSchema/${dataSetId}`,
|
|
{
|
|
method: 'GET',
|
|
},
|
|
);
|
|
}
|