import http from '@/api'
import { WarningVO, WarningForm, WarningQuery } from '@/api/interface/als/warning'
/**
 * @name 查询警告信息列表
 * @param query 参数
 * @returns 返回列表
 */
export const listWarningApi = (query: WarningQuery) => {
  return http.get<WarningVO[]>('/als/warning/list', query, { loading: false })
}

/**
 * @name 查询警告信息详细
 * @param id id
 * @returns returns
 */
export const getWarningApi = (id: string | number) => {
  return http.get<WarningVO>(`/als/warning/${id}`)
}

/**
 * @name 新增警告信息
 * @param data data
 * @returns returns
 */
export const addWarningApi = (data: WarningForm) => {
  return http.post<any>('/als/warning', data, { loading: false })
}

/**
 * @name 修改警告信息
 * @param data data
 * @returns returns
 */
export const updateWarningApi = (data: WarningForm) => {
  return http.put<any>('/als/warning', data, { loading: false })
}

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

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

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

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