import request from '@/config/axios'

// 设备状态调整日志 VO
export interface IotDeviceStatusLogVO {
  id: number // 主键id
  deviceId: number // 设备id
  oldStatus: string // 设备修改前状态
  newStatus: string // 设备修改后状态
  reason: string // 设备状态调整原因
  remark: string // 备注
}

// 设备状态调整日志 API
export const IotDeviceStatusLogApi = {
  // 查询设备状态调整日志分页
  getIotDeviceStatusLogPage: async (params: any) => {
    return await request.get({ url: `/pms/iot-device-status-log/page`, params })
  },

  // 查询设备状态调整日志详情
  getIotDeviceStatusLog: async (id: number) => {
    return await request.get({ url: `/pms/iot-device-status-log/get?id=` + id })
  },

  // 新增设备状态调整日志
  createIotDeviceStatusLog: async (data: IotDeviceStatusLogVO) => {
    return await request.post({ url: `/pms/iot-device-status-log/create`, data })
  },

  // 修改设备状态调整日志
  updateIotDeviceStatusLog: async (data: IotDeviceStatusLogVO) => {
    return await request.put({ url: `/pms/iot-device-status-log/update`, data })
  },

  // 删除设备状态调整日志
  deleteIotDeviceStatusLog: async (id: number) => {
    return await request.delete({ url: `/pms/iot-device-status-log/delete?id=` + id })
  },

  // 导出设备状态调整日志 Excel
  exportIotDeviceStatusLog: async (params) => {
    return await request.download({ url: `/pms/iot-device-status-log/export-excel`, params })
  },
}
