import request from "@/utils/request2";
import { myRequestInstance } from "@/utils/request2";

// 目录列表查询
export function getCatalogList(data) {
  return request({
    url: "/catalog/list",
    method: "post",
    data: {
      ...data,
    },
  });
}

// 查询目录详情
export function getCatalogDetail(data) {
  return request({
    url: "/catalog/getCatalogDetail",
    method: "post",
    data: {
      ...data,
    },
  });
}


// 新增目录
export function saveCatalog(data) {
    return request({
      url: "/catalog/save",
      method: "post",
      data: {
        ...data,
      },
    });
  }

  // 目录更新
export function updateCatalog(data) {
  return request({
    url: "/catalog/update",
    method: "post",
    data: {
      ...data,
    },
  });
}

  export function removeCatalog(data) {
    return request({
      url: "/catalog/remove",
      method: "post",
      data: {
        ...data,
      },
    });
  }
// 目录发布
export function publishCatalog(data) {
  return request({
    url: "/catalog/publish",
    method: "post",
    data: {
      ...data,
    },
  });
}

// 目录失效
export function InvalidCatalog(data) {
  return request({
    url: "/catalog/invalid",
    method: "post",
    data: {
      ...data,
    },
  });
}
  // 批量删除目录
export function removeBatchCatalog(data) {
    return request({
      url: "/catalog/removeBatch",
      method: "post",
      data: {
        ...data,
      },
    });
  }

  // 查询项目规则
export function queryGovernanceRuleByName(data) {
  return myRequestInstance({
    url: '/rule/queryGovernanceRuleByName',
    method: "post",
    // headers:{
    //     'Content-Type': 'application/x-www-form-urlencoded'
    // },
    data: {
      ...data,
    },
  })
}

export function queryDatabase(data) {
  return request({
    url: '/database/queryDatabase',
    method: "post",
    data: {
      ...data
    }
  })
}

//查询表
export function getEtlTableList(data) {
  return request({
    url: "/database/getEtlTableList",
    method: "post",
    data: {
      ...data,
    },
  });
}

export function getEtlTableFields(data) {
  return request({
    url: "/database/getEtlTableFields",
    method: "post",
    data: {
      ...data,
    },
  });
}

