import request from '@/utils/request'

// 查询空间设备列表
export function listSpace_device(query) {
    return request({
        url: '/iot/space_device/list',
        method: 'get',
        params: query
    })
}

// 查询空间设备详细
export function getSpace_device(spaceId) {
    return request({
        url: '/iot/space_device/' + spaceId,
        method: 'get'
    })
}

// 新增空间设备
export function addSpace_device(data) {
    return request({
        url: '/iot/space_device',
        method: 'post',
        data: data
    })
}

// 修改空间设备
export function updateSpace_device(data) {
    return request({
        url: '/iot/space_device',
        method: 'put',
        data: data
    })
}

// 删除空间设备
export function delSpace_device(spaceId) {
    return request({
        url: '/iot/space_device/device/' + spaceId,
        method: 'delete'
    })
}

// 导出空间设备
export function exportSpace_device(query) {
    return request({
        url: '/iot/space_device/export',
        method: 'get',
        params: query
    })
}

// 根据项目ID查询项目下所有设备
export function listProjectDevice(data) {
  return request({
      url: '/iot/space_device/not-used',
      method: 'get',
      params: data
  })
}
