import request from '@/utils/request'

// 查询数据源管理列表
export function listDatasource(query) {
  return request({
    url: '/VRdemo/datasource/list',
    method: 'get',
    params: query
  })
}

// 查询companyApp表中的spots数据
export function listSpot(query) {
  return request({
    url: '/VRdemo/datasource/SpotList',
    method: 'get',
    params: query
  })
}


// 查询数据源管理详细
export function getDatasource(dataSourceId) {
  return request({
    url: '/VRdemo/datasource/' + dataSourceId,
    method: 'get'
  })
}

// 新增数据源管理
export function addDatasource(data) {
  return request({
    url: '/VRdemo/datasource',
    method: 'post',
    data: data
  })
}

// 修改数据源管理
export function updateDatasource(data) {
  return request({
    url: '/VRdemo/datasource',
    method: 'put',
    data: data
  })
}

// 删除数据源管理
export function delDatasource(dataSourceId) {
  return request({
    url: '/VRdemo/datasource/' + dataSourceId,
    method: 'delete'
  })
}

//修改应用状态
export function updateDataSourceStatus(dataSourceId, status) {
  const data = {
    dataSourceId,
    status
  }
  return request({
    url: '/VRdemo/datasource/changeStatus',
    method: 'put',
    data: data
  })
}

// 查询数据类型信息
export function listDataType(query) {
  return request({
    url: '/VRdemo/datasource/dataTypeInfo',
    method: 'get',
    params: query
  })
}



// 卸载spot
export function removeSpot(data) {
  return request({
    url: '/VRdemo/datasource/removeSpot',
    method: 'post',
    data: data
  })
}



export function getSpotByDT(dataSourceId) {
  return request({
    url: '/VRdemo/datasource/getSpotByDT/' + dataSourceId,
    method: 'get'
  })
}

