import request from '@/utils/request'

// 查询数据接入基本信息列表
export function listSource(query) {
  return request({
    url: '/source/source/list',
    method: 'get',
    params: query
  })
}

// 查询数据接入基本信息详细
export function getSource(id) {
  return request({
    url: '/source/source/' + id,
    method: 'get'
  })
}

export function typeList() {
  return request({
    url: '/source/type/typeList',
    method: 'get'
  })
}


// 新增数据接入基本信息
export function addSource(data) {
  return request({
    url: '/source/source/add',
    method: 'post',
    data: data
  })
}

// 修改数据接入基本信息
export function updateSource(data) {
  return request({
    url: '/source/source/'+data.id,
    method: 'put',
    data: data
  })
}

// 删除数据接入基本信息
export function delSource(id) {
  return request({
    url: '/source/source/' + id,
    method: 'delete'
  })
}

export function connectTest(id) {
  return request({
    url: '/source/source/connect?id=' + id,
    method: 'post'
  })
}

export function synchronization(data) {
  return request({
    url: '/source/structure/'+data.id,
    method: 'post'
  })
}
