You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.2 KiB
34 lines
1.2 KiB
1 month ago
|
import type { ModelCardItem, ModelInfo, ModelQueryParams } from './model/models'
|
||
|
import { defHttp } from '@/utils/http/axios'
|
||
|
|
||
|
enum Api {
|
||
|
MODEL_CARD_LIST = '/alert/model/card/list',
|
||
|
MODEL_INFO = '/alert/model/info/',
|
||
|
MODEL_SAVE = '/alert/model/',
|
||
|
MODEL_DATA = '/alert/model/data/',
|
||
|
CALCULATE_BACK = '/alert/model/data/calculate/',
|
||
|
OPTIMISTIC = '/alert/optimistic',
|
||
|
}
|
||
|
export function modelCardListApi(params?: ModelQueryParams) {
|
||
|
return defHttp.get<ModelCardItem[]>({ url: Api.MODEL_CARD_LIST, params })
|
||
|
}
|
||
|
|
||
|
export const modelInfoApi = (id: any) => defHttp.get<ModelInfo>({ url: Api.MODEL_INFO + id })
|
||
|
|
||
|
export function updateModelInfo(params: any) {
|
||
|
return defHttp.patch<boolean>({ url: Api.MODEL_INFO, params })
|
||
|
}
|
||
|
|
||
|
export function modelSaveApi(params?: any) {
|
||
|
return defHttp.post<number>({ url: Api.MODEL_SAVE, data: params })
|
||
|
}
|
||
|
|
||
|
export function modelDataApi(id: any, params: any) {
|
||
|
return defHttp.get<any>({ url: Api.MODEL_DATA + id, params })
|
||
|
}
|
||
|
|
||
|
export function calculateBackApi(id: any, params: any) {
|
||
|
return defHttp.post<boolean>({ url: Api.CALCULATE_BACK + id, params })
|
||
|
}
|
||
|
export const getOptimisticApi = (params: any) => defHttp.get<any>({ url: Api.OPTIMISTIC, params })
|