import request from "@/utils/request";

// 查询项目空间列表
export function listSpace(query) {
  return request({
    url: "/iot/space/list",
    method: "get",
    params: query
  });
}

// 查询项目空间详细
export function getSpace(spaceId) {
  return request({
    url: "/iot/space/" + spaceId,
    method: "get"
  });
}

// 新增项目空间
export function addSpace(data) {
  return request({
    url: "/iot/space",
    method: "post",
    data: data
  });
}

// 修改项目空间
export function updateSpace(data) {
  return request({
    url: "/iot/space",
    method: "put",
    data: data
  });
}

// 删除项目空间
export function delSpace(spaceId) {
  return request({
    url: "/iot/space/" + spaceId,
    method: "delete"
  });
}

// 导出项目空间
export function exportSpace(query) {
  return request({
    url: "/iot/space/export",
    method: "get",
    params: query
  });
}

// 查询项目空间列表
export function listSpaceDevice(query) {
  return request({
    url: "/iot/space_device/list",
    method: "get",
    params: query
  });
}

// 获取项目空间下拉树列表
export function listSpaceTree(query) {
  return request({
    url: "/iot/space/tree-list",
    method: "get",
    params: query
  });
}
