import http from '@/api'
import { LifePredictionResultVO, LifePredictionResultForm, LifePredictionResultQuery } from '@/api/interface/als/lifePredictionResult'
/**
 * @name 查询寿命预测结果列表
 * @param query 参数
 * @returns 返回列表
 */
export const listLifePredictionResultApi = (query: LifePredictionResultQuery) => {
  return http.get<LifePredictionResultVO[]>('/als/lifePredictionResult/list', query, { loading: true })
}

/**
 * @name 查询寿命预测结果详细
 * @param id id
 * @returns returns
 */
export const getLifePredictionResultApi = (id: string | number) => {
  return http.get<LifePredictionResultVO>(`/als/lifePredictionResult/${id}`)
}

/**
 * @name 新增寿命预测结果
 * @param data data
 * @returns returns
 */
export const addLifePredictionResultApi = (data: LifePredictionResultForm) => {
  return http.post<any>('/als/lifePredictionResult', data, { loading: false })
}

/**
 * @name 修改寿命预测结果
 * @param data data
 * @returns returns
 */
export const updateLifePredictionResultApi = (data: LifePredictionResultForm) => {
  return http.put<any>('/als/lifePredictionResult', data, { loading: false })
}

/**
 * @name 删除寿命预测结果
 * @param id id
 * @returns returns
 */
export const delLifePredictionResultApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/lifePredictionResult/${id}`)
}

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