(feature)(webapp) rename interface modelList to viewList (#702)

This commit is contained in:
williamhliu
2024-01-30 20:47:31 +08:00
committed by GitHub
parent 24b442baef
commit df975b231d
3 changed files with 34 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
import { request } from "umi";
import { AgentType, MetricType, ModelType } from "./type";
import { request } from 'umi';
import { AgentType, MetricType, ModelType } from './type';
export function getAgentList() {
return request<Result<AgentType[]>>('/api/chat/agent/getAgentList');
@@ -8,7 +8,7 @@ export function getAgentList() {
export function saveAgent(agent: AgentType) {
return request<Result<any>>('/api/chat/agent', {
method: agent?.id ? 'PUT' : 'POST',
data: {...agent, status: agent.status !== undefined ? agent.status : 1},
data: { ...agent, status: agent.status !== undefined ? agent.status : 1 },
});
}
@@ -19,18 +19,18 @@ export function deleteAgent(id: number) {
}
export function getModelList() {
return request<Result<ModelType[]>>('/api/chat/conf/modelList', {
return request<Result<ModelType[]>>('/api/chat/conf/viewList', {
method: 'GET',
});
}
export function getMetricList(modelId: number) {
return request<Result<{list: MetricType[]}>>('/api/semantic/metric/queryMetric', {
return request<Result<{ list: MetricType[] }>>('/api/semantic/metric/queryMetric', {
method: 'POST',
data: {
modelIds: [modelId],
current: 1,
pageSize: 2000
}
pageSize: 2000,
},
});
}

View File

@@ -1,5 +1,5 @@
import { request } from "umi";
import { DimensionType, ModelType, PluginType } from "./type";
import { request } from 'umi';
import { DimensionType, ModelType, PluginType } from './type';
export function savePlugin(params: Partial<PluginType>) {
return request<Result<any>>('/api/chat/plugin', {
@@ -11,7 +11,7 @@ export function savePlugin(params: Partial<PluginType>) {
export function getPluginList(filters?: any) {
return request<Result<any[]>>('/api/chat/plugin/query', {
method: 'POST',
data: filters
data: filters,
});
}
@@ -22,18 +22,18 @@ export function deletePlugin(id: number) {
}
export function getModelList() {
return request<Result<ModelType[]>>('/api/chat/conf/modelList', {
return request<Result<ModelType[]>>('/api/chat/conf/viewList', {
method: 'GET',
});
}
export function getDimensionList(modelId: number) {
return request<Result<{list: DimensionType[]}>>('/api/semantic/dimension/queryDimension', {
return request<Result<{ list: DimensionType[] }>>('/api/semantic/dimension/queryDimension', {
method: 'POST',
data: {
modelIds: [modelId],
current: 1,
pageSize: 2000
}
pageSize: 2000,
},
});
}