import http from '@/api'
import { FaultDiagnosisResultVO, FaultDiagnosisResultForm, FaultDiagnosisResultQuery } from '@/api/interface/als/faultDiagnosisResult'
/**
 * @name 查询故障诊断结果列表
 * @param query 参数
 * @returns 返回列表
 */
export const listFaultDiagnosisResultApi = (query: FaultDiagnosisResultQuery) => {
  return http.get<FaultDiagnosisResultVO[]>('/als/faultDiagnosisResult/list', query, { loading: true })
}

/**
 * @name 查询故障诊断结果详细
 * @param id id
 * @returns returns
 */
export const getFaultDiagnosisResultApi = (id: string | number) => {
  return http.get<FaultDiagnosisResultVO>(`/als/faultDiagnosisResult/${id}`)
}

/**
 * @name 新增故障诊断结果
 * @param data data
 * @returns returns
 */
export const addFaultDiagnosisResultApi = (data: FaultDiagnosisResultForm) => {
  return http.post<any>('/als/faultDiagnosisResult', data, { loading: false })
}

/**
 * @name 修改故障诊断结果
 * @param data data
 * @returns returns
 */
export const updateFaultDiagnosisResultApi = (data: FaultDiagnosisResultForm) => {
  return http.put<any>('/als/faultDiagnosisResult', data, { loading: false })
}

/**
 * @name 删除故障诊断结果
 * @param id id
 * @returns returns
 */
export const delFaultDiagnosisResultApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/faultDiagnosisResult/${id}`)
}

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