import request from '@/utils/request';
import type { EmsActionResponse, EmsDetailResponse, FaultHandlingRecordVO, EmsId, EmsIdParam, EmsListResponse, EmsQuery } from '../types';

// 查询故障处置记录列表
export function listFaultHandlingRecord(query?: EmsQuery): Promise<EmsListResponse<FaultHandlingRecordVO>> {
  return request({
    url: '/ems/info/faultHandlingRecord/list',
    method: 'get',
    params: query
  });
}

// 查询故障处置记录详细
export function getFaultHandlingRecord(id: EmsId): Promise<EmsDetailResponse<FaultHandlingRecordVO>> {
  return request({
    url: '/ems/info/faultHandlingRecord/' + id,
    method: 'get'
  });
}

// 新增故障处置记录
export function addFaultHandlingRecord(data: FaultHandlingRecordVO): Promise<EmsActionResponse<FaultHandlingRecordVO>> {
  return request({
    url: '/ems/info/faultHandlingRecord',
    method: 'post',
    data: data
  });
}

// 修改故障处置记录
export function updateFaultHandlingRecord(data: FaultHandlingRecordVO): Promise<EmsActionResponse<FaultHandlingRecordVO>> {
  return request({
    url: '/ems/info/faultHandlingRecord',
    method: 'put',
    data: data
  });
}

// 删除故障处置记录
export function delFaultHandlingRecord(id: EmsIdParam): Promise<EmsActionResponse> {
  return request({
    url: '/ems/info/faultHandlingRecord/' + id,
    method: 'delete'
  });
}
