import request from '@/utils/request'

// 查询数据源列表
export function listSource(query) {
  return request({
    url: '/dataSource/source/list',
    method: 'get',
    params: query
  })
}
export function testConnection(data) {
  return request({
    url: '/dataSource/source/testConnection',
    method: 'post',
    data
  })
}
// 查询接入类型列表
export function listType() {
  return request({
    url: '/dataSource/source/findAccessType',
    method: 'get',
  })
}

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

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

// 修改数据源
export function updateSource(data) {
  return request({
    url: '/dataSource/source/'+data.id,
    method: 'put',
    data: data
  })
}
//同步数据库接入
export function Synchronization(data){
  return request({
    url:'/dataSource/source/synchronization',
    method:'post',
    data:data
  })
}

// 删除数据源
export function delSource(id) {
  return request({
    url: '/dataSource/source/' + id,
    method: 'delete'
  })
}

//资产属性列表
export function testList(){
  return request({
    url:'/dataSource/source/findTest',
    method:'get'
  })
}
