import http from '@/api'
import { LifePredictionVO, LifePredictionForm, LifePredictionQuery } from '@/api/interface/als/lifePrediction'
/**
 * @name 查询寿命预测列表
 * @param query 参数
 * @returns 返回列表
 */
export const listLifePredictionApi = (query: LifePredictionQuery) => {
  return http.get<LifePredictionVO[]>('/als/lifePrediction/list', query, { loading: true })
}

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

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

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

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

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