import request from '@/config/axios'

export interface DeviceOperationRecordVO {
  id: number
  deviceCode: string
  deviceName: string
  totalRunningTime: number
  totalStandbyTime: number
  totalFaultTime: number
  totalWarningTime: number
  utilizationRate: string
}

export interface DeviceOperationRecordPageParams {
  pageNo: number
  pageSize: number
  deviceCode?: string
  deviceName?: string
  startTime?: string
  endTime?: string
  ids?: string
}

export const DeviceOperationRecordApi = {
  getDeviceOperationRecordPage: async (params: DeviceOperationRecordPageParams) => {
    return await request.get({ url: `/iot/device-operation-record/deviceOperationPage`, params })
  },
  exportDeviceOperationReport: async (params: DeviceOperationRecordPageParams) => {
    return await request.download({ url: `/iot/device-operation-record/export-device-operation-report`, params })
  }
}
