import request from '@/utils/request'

// 查询数据接入列表
export function listAccess(query) {
  return request({
    url: '/system/access/list',
    method: 'get',
    params: query
  })
}

export function lists(data) {
  return request({
    url: '/system/access/lists',
    method: 'post',
    data
  })
}

// 查询数据接入详细
export function getAccess(id) {
  return request({
    url: '/system/access/' + id,
    method: 'get'
  })
}

// 新增数据接入
export function addAccess(data) {
  return request({
    url: '/system/access',
    method: 'post',
    data: data
  })
}

// 修改数据接入
export function updateAccess(data) {
  return request({
    url: '/system/access',
    method: 'put',
    data: data
  })
}

// 删除数据接入
export function delAccess(id) {
  return request({
    url: '/system/access/' + id,
    method: 'delete'
  })
}

export function library() {
  return request({
    url: '/system/access/library',
    method: 'get'
  })
}

export function selectTable(libraryName) {
  return request({
    url: '/system/access/selectTable/' + libraryName,
    method: 'get'
  })
}

export function oneDataAccess(data) {
  return request({
    url: '/system/access/oneDataAccess',
    method: 'post',
    data
  })
}

/**
 * 同步
 * @param data
 * @returns {AxiosPromise}
 */
export function synchronization(data) {
  return request({
    url: '/system/access/synchronization',
    method: 'post',
    data
  })
}




