import request from '@/config/axios'

// 设备责任人日志 VO
export interface IotDevicePersonLogVO {
  id: number // 主键id
  deviceId: number // 设备id
  oldPersonId: number // 设备调整前责任人
  oldPersonIds: string // 设备调整前责任人id集合
  newPersonId: number // 设备调整后责任人
  newPersonIds: string // 设备调整后责任人id集合
  reason: string // 调整原因
  remark: string // 备注
}

// 设备责任人日志 API
export const IotDevicePersonLogApi = {
  // 查询设备责任人日志分页
  getIotDevicePersonLogPage: async (params: any) => {
    return await request.get({ url: `/pms/iot-device-person-log/page`, params })
  },

  // 查询设备责任人日志详情
  getIotDevicePersonLog: async (id: number) => {
    return await request.get({ url: `/pms/iot-device-person-log/get?id=` + id })
  },

  // 新增设备责任人日志
  createIotDevicePersonLog: async (data: IotDevicePersonLogVO) => {
    return await request.post({ url: `/pms/iot-device-person-log/create`, data })
  },

  // 修改设备责任人日志
  updateIotDevicePersonLog: async (data: IotDevicePersonLogVO) => {
    return await request.put({ url: `/pms/iot-device-person-log/update`, data })
  },

  // 删除设备责任人日志
  deleteIotDevicePersonLog: async (id: number) => {
    return await request.delete({ url: `/pms/iot-device-person-log/delete?id=` + id })
  },

  // 导出设备责任人日志 Excel
  exportIotDevicePersonLog: async (params) => {
    return await request.download({ url: `/pms/iot-device-person-log/export-excel`, params })
  },
}
