import request from '@/utils/request'

// 新增或修改IOT
export function addOrUpdate(data) {
  return request({
    url: '/material/iotMachine/addOrUpdate',
    method: 'post',
    data,
  })
}

// IOT列表
export function getIotList(params = {}) {
  return request({
    url: '/material/iotMachine/getIotList',
    method: 'get',
    params,
  })
}

// 删除IOT /iotMachine/deleteById/{iotId}
export function deleteIotById(params) {
  return request({
    url: '/material/iotMachine/deleteById/' + params,
    method: 'delete',
  })
}

// IOT下拉列表 /iotMachine/selectList
export function selectList(params = {}) {
  return request({
    url: '/material/iotMachine/selectList',
    method: 'get',
    params,
  })
}

// 绑定IOT /iotMachine/bind
export function bindIot(data) {
  return request({
    url: '/material/iotMachine/bind',
    method: 'post',
    data,
  })
}

// 解绑IOT /iotMachine/unbind
export function unbindIot(data) {
  return request({
    url: '/material/iotMachine/unbind',
    method: 'post',
    data,
  })
}

// 获取绑定IOT列表 /iotMachine/getTypeList
export function getTypeList(params = {}) {
  return request({
    url: '/material/iotMachine/getTypeList',
    method: 'get',
    params,
  })
}
// 获取绑定IOT列表 /iotMachine/getTypeList
export function getTypeListApi(params = {}) {
  return request({
    url: '/material/iotMachine/getTypeList',
    method: 'get',
    params,
  })
}

// 绑定详情 /iotMachine/getRecordList
export function getRecordList(params = {}) {
  return request({
    url: '/material/iotMachine/getRecordList',
    method: 'get',
    params,
  })
}

// 所有绑定详情 /iotMachine/getRecordListAll
export function getRecordListAll(params = {}) {
  return request({
    url: '/material/iotMachine/getRecordListAll',
    method: 'get',
    params,
  })
}

/** 获取机具设备的位置信息 */
export const getIotDeviceLocationApi = (data) => {
  return request.post('/material/iotMachine/getLocation', data)
}
/** 获取机具设备的行程信息 */
export const getIotDeviceTripApi = (data) => {
  return request.post('/material/iotMachine/searchItinerary', data)
}
/** 获取机具设备的停留点信息 */
export const getIotDeviceParkDetailApi = (data) => {
  return request.post('/material/iotMachine/reportParkDetailByTime', data)
}
/** 获取机具设备的报警信息 */
export const getIotDeviceAlarmApi = (data) => {
  return request.post('/material/iotMachine/reportAlarm', data)
}
