import request from '@/utils/request'

// 查询共享数据列表
export function listData(query) {
  return request({
    url: '/system/share/data/list',
    method: 'get',
    params: query
  })
}

// 查询共享数据详细
export function getData(id) {
  return request({
    url: '/system/share/data/' + id,
    method: 'get'
  })
}

// 查询共享数据明细
export function getDataItem(id, checkChanged = null) {
  return request({
    url: '/system/share/data/dataitem?id=' + id + "&checkChanged=" + checkChanged,
    method: 'get'
  })
}

// 新增共享数据
export function addData(data) {
  return request({
    url: '/system/share/data',
    method: 'post',
    data: data
  })
}

// 挂载共享数据
export function mountData(data) {
  return request({
    url: '/system/share/data/mount',
    method: 'post',
    data: data
  })
}

// 审核共享数据
export function auditData(data) {
  return request({
    url: '/system/share/data/audit',
    method: 'post',
    data: data
  })
}

// 修改共享数据
export function updateData(data) {
  return request({
    url: '/system/share/data',
    method: 'put',
    data: data
  })
}

// 删除共享数据
export function delData(id) {
  return request({
    url: '/system/share/data/' + id,
    method: 'delete'
  })
}
