import request from '@/utils/request'

// 查询设备列列表
export function listDevice(query) {
  return request({
    url: '/system/device/list',
    method: 'get',
    params: query
  })
}

// 查询设备列详细
export function getDevice(id) {
  return request({
    url: '/system/device/' + id,
    method: 'get'
  })
}

// 新增设备列
export function addDevice(data) {
  return request({
    url: '/system/device',
    method: 'post',
    data: data
  })
}

// 修改设备列
export function updateDevice(data) {
  return request({
    url: '/system/device',
    method: 'put',
    data: data
  })
}

// 删除设备列
export function delDevice(id) {
  return request({
    url: '/system/device/' + id,
    method: 'delete'
  })
}
export function getHeartRate(data) {
  return request({
    url: '/system/device/heartRate',
    method: 'get',
    params: data
  })
}
export function getBloodRate(data) {
  return request({
    url: '/system/device/bloodRate',
    method: 'get',
    params: data
  })
}
export function getOxygenRate(data) {
  return request({
    url: '/system/device/oxygenRate',
    method: 'get',
    params: data
  })
}
export function getTempRate(data) {
  return request({
    url: '/system/device/tempRate',
    method: 'get',
    params: data
  })
}
export function getStepRate(data) {
  return request({
    url: '/system/device/stepRate',
    method: 'get',
    params: data
  })
}
export function getRollRate(data) {
  return request({
    url: '/system/device/rollRate',
    method: 'get',
    params: data
  })
}
export function getDeviceLog(data) {
  return request({
    url: '/system/device/messageLogRate',
    method: 'get',
    params: data
  })
}
export function setDeviceInterval(data) {
  return request({
    url: '/system/device/deviceValue',
    method: 'post',
    data: data
  })
}
export function addFence(data) {
  return request({
    url: '/system/electronic/fence',
    method: 'post',
    data: data
  })
}
export function getFenceList(data) {
  return request({
    url: `/system/electronic/fence/list/device/${data}`,
    method: 'get',
  })
}
export function deleteFence(data) {
  return request({
    url: `/system/electronic/fence/${data}`,
    method: 'delete',
  })
}
export function updateFence(data) {
  return request({
    url: '/system/electronic/fence/edit',
    method: 'put',
    data: data
  })
}