import request from '@/utils/request'

// 查询数据源列表
export function listSource(query) {
  return request({
    url: '/source/source/list',
    method: 'get',
    params: query
  })
}
// 测试连接
export function testConnection(data) {
  return request({
    url: '/source/source/test',
    method: 'post',
    data: data
  })
}

// 查询数据源详细
export function getSource(id) {
  return request({
    url: '/source/source/getDataSourceById/' + id,
    method: 'get'
  })
}

// 新增数据源
export function addSource(data) {
  return request({
    url: '/source/source',
    method: 'post',
    data: data
  })
}

// 修改数据源
export function updateSource(data) {
  return request({
    url: '/source/source',
    method: 'put',
    data: data
  })
}

// 删除数据源
export function delSource(id) {
  return request({
    url: '/source/source/' + id,
    method: 'delete'
  })
}
//同步资产结构
export function synchronous(data) {
  return request({
    url: '/source/source/syncAssetStructure',
    method: 'post',
    data: data
  })
}
