import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { FaultMessageVO, FaultMessageForm, FaultMessageQuery } from './model';

/**
 * 查询故障消息;列表
 * @param params
 * @returns
 */
export function faultMessageList(params?: FaultMessageQuery) {
  return defHttp.get<FaultMessageVO[]>({ url: '/fault/faultMessage/list', params });
}

/**
 * 导出故障消息;列表
 * @param params
 * @returns
 */
export function faultMessageExport(params?: FaultMessageQuery) {
  return commonExport('/fault/faultMessage/export', params ?? {});
}

/**
 * 查询故障消息;详细
 * @param id id
 * @returns
 */
export function faultMessageInfo(id: ID) {
  return defHttp.get<FaultMessageVO>({ url: '/fault/faultMessage/' + id });
}
/**
 * 确认故障消息
 * @param id id
 * @returns
 */
export function confirmMessageInfo(data) {
  return defHttp.putWithMsg({ url: '/fault/faultMessage/confirm', data });
}
/**
 * 新增故障消息;
 * @param data
 * @returns
 */
export function faultMessageAdd(data: FaultMessageForm) {
  return defHttp.postWithMsg<void>({ url: '/fault/faultMessage', data });
}

/**
 * 更新故障消息;
 * @param data
 * @returns
 */
export function faultMessageUpdate(data: FaultMessageForm) {
  return defHttp.putWithMsg<void>({ url: '/fault/faultMessage', data });
}

/**
 * 删除故障消息;
 * @param id id
 * @returns
 */
export function faultMessageRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/fault/faultMessage/' + id });
}
