import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { RfidDowntimeRecordQuery, RfidDowntimeRecordVO } from './types';

/**
 * 查询停机记录列表（上位机写入，web只读）
 * @param query 查询条件
 */
export const listDowntimeRecord = (query?: RfidDowntimeRecordQuery): AxiosPromise<RfidDowntimeRecordVO[]> => {
  return request({
    url: '/rfid/downtimeRecord/list',
    method: 'get',
    params: query
  });
};

/**
 * 导出停机记录
 * @param query 查询条件
 */
export const exportDowntimeRecord = (query?: RfidDowntimeRecordQuery) => {
  return request({
    url: '/rfid/downtimeRecord/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  });
};
