import request from "@/utils/request";

// 查询服务共享列表
export function listService(query) {
  return request({
    url: "/system/share/service/list",
    method: "get",
    params: query,
  });
}

// 查询服务共享详细
export function getService(id) {
  return request({
    url: "/system/share/service/" + id,
    method: "get",
  });
}

// 获取数据项
export function getServiceItem(id, checkChanged = null) {
  return request({
    url:
      "/system/share/service/serviceitem?id=" +
      id +
      "&checkChanged=" +
      checkChanged,
    method: "get",
  });
}

// 新增服务共享
export function addService(data) {
  return request({
    url: "/system/share/service",
    method: "post",
    data: data,
  });
}

// 挂载
export function mountService(data) {
  return request({
    url: "/system/share/service/mount",
    method: "post",
    data: data,
  });
}

// 审核共享服务
export function auditService(data) {
  return request({
    url: '/system/share/service/audit',
    method: 'post',
    data: data
  })
}

// 修改服务共享
export function updateService(data) {
  return request({
    url: "/system/share/service",
    method: "put",
    data: data,
  });
}

// 删除服务共享
export function delService(id) {
  return request({
    url: "/system/share/service/" + id,
    method: "delete",
  });
}
