import request from '@/utils/request'
export function addDevice(data) {
  return request({
    url: '/devices',
    method: 'post',
    data
  })
}
export function getChildren(data) {
  return request({
    url: '/devices/' + data.id + '/children',
    method: 'get'
  })
}
export function getRootDevices(data) {
  return request({
    url: '/devices/level/0',
    method: 'get'
  })
}
export function deleteDevice(data) {
  return request({
    url: '/devices/' + data.id,
    method: 'delete'
  })
}
export function getChildrenDataSources(data) {
  return request({
    url: '/devices/' + data.id + '/childrenDataSources',
    method: 'get'
  })
}
export function getAllDevices(data) {
  return request({
    url: '/devices',
    method: 'get'
  })
}
