import http from '@/api'
import { ModelVO, ModelForm, ModelQuery } from '@/api/interface/als/model'
/**
 * @name 查询模型信息列表
 * @param query 参数
 * @returns 返回列表
 */
export const listModelApi = (query: ModelQuery) => {
  return http.get<ModelVO[]>('/als/model/list', query, { loading: false })
}

/**
 * @name 查询模型信息详细
 * @param id id
 * @returns returns
 */
export const getModelApi = (id: string | number) => {
  return http.get<ModelVO>(`/als/model/${id}`)
}

/**
 * @name 新增模型信息
 * @param data data
 * @returns returns
 */
export const addModelApi = (data: ModelForm) => {
  return http.post<any>('/als/model', data, { loading: false })
}

/**
 * @name 修改模型信息
 * @param data data
 * @returns returns
 */
export const updateModelApi = (data: ModelForm) => {
  return http.put<any>('/als/model', data, { loading: false })
}

/**
 * @name 删除模型信息
 * @param id id
 * @returns returns
 */
export const delModelApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/model/${id}`)
}

/**
 * @name 下载模板
 * @returns returns
 */
export const importTemplateApi = () => {
  return http.downloadPost('/als/model/importTemplate', {})
}

/**
 * @name 导入数据
 * @returns returns
 */
export const importModelDataApi = (data: any) => {
  return http.post('/als/model/importData', data)
}

/**
 * @name 导出数据
 * @returns returns
 */
export const exportModelApi = (data: any) => {
  return http.post('/als/model/export', data)
}
