import request from "@/utils/request";

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

// 查询项目详细
export function getProject(projectId) {
  return request({
    url: "/iot/project/" + projectId,
    method: "get"
  });
}

// 导出项目
export function exportProject(query) {
  return request({
    url: "/iot/project/export",
    method: "get",
    params: query
  });
}

// 根据项目ID查询项目下所有设备
export function listDeviceByProjectId(projectId) {
  return request({
    url: "/iot/space_device/device/" + projectId,
    method: "get"
  });
}

// 查询项目空间列表
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 listSpaceTree(query) {
  return request({
    url: "/iot/space/tree-list",
    method: "get",
    params: query
  });
}

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