import { request } from '@@/plugin-request/request';
import { stringify } from 'qs';

/**
 * 查询设备故障列表
 * @param param
 */
export async function queryDeviceFaults(param: object) {
  return request(`/web/v1/device_faults?${stringify(param)}`);
}

/**
 * 查询设备故障详情
 * @param id
 */
export async function queryDeviceFaultsDetail(id: object) {
  return request(`/web/v1/device_faults/${id}`);
}

/**
 * 更新故障信息
 * @param params
 */
export async function updateDeviceFaults(params: any) {
  return request(`/web/v1/device_faults/${params.record_id}`, {
    method: 'PUT',
    data: params,
  });
}
