import http from '@/utils/request'

// ======================= 数据域 ============================== //
// 元数据组合(数据域)列表
export function combinationList (params) {
  return http.post('/dataFactory/meta/data/combination/page', params)
}
// 详情
export function combinationDetail (params) {
  return http.post('/dataFactory/meta/data/combination/detail', params)
}

// 数据域标签管理
// 删除
export function combinationTagsDel (params) {
  return http.post('/dataFactory/meta/data/combination/tags/del', params)
}
// 保存
export function combinationTagsSave (params) {
  return http.post('/dataFactory/meta/data/combination/tags/save', params)
}
// 详情
export function combinationTagsDetail (params) {
  return http.post('/dataFactory/meta/data/combination/tags/detail', params)
}
// 列表
export function combinationTagsPage (params) {
  return http.post('/dataFactory/meta/data/combination/tags/page', params)
}

// 元数据
// 元数据列表
export function dataFactoryMetaDataList (params) {
  return http.post('/dataFactory/meta/data/list', params)
}
// 元数据数据类型字典
export function metaDataTypes () {
  return http.post('/dataFactory/meta/data/types')
}
// 新增
export function metaDataAdd (params) {
  return http.post('/dataFactory/meta/data/add', params)
}
// 修改
export function metaDataUpdate (params) {
  return http.post('/dataFactory/meta/data/update', params)
}

// 删除
export function metaDataDel (params) {
  return http.post('/dataFactory/meta/data/delete', params)
}
// 查询是否有元数据使用
export function checkMetaData (params) {
  return http.post('/dataFactory/data/relation/check/metadataId', params)
}
// 血缘关系图谱
export function metaDataConsanguinity (params) {
  return http.post('/dataFactory/meta/data/consanguinity/atlas', params)
}
// 血缘关系图谱(新)
export function metaDataConsanguinity2 (params) {
  return http.post('/graph/show/metaData', params)
}
// 元数据明细
export function metaDataDetail (params) {
  return http.post('/dataFactory/meta/data/detail', params)
}
// 元数据合并
export function metaDataMerge (params) {
  return http.post('/dataFactory/meta/data/merge', params)
}

// 删除
export function combinationDel (params) {
  return http.post('/dataFactory/meta/data/combination/del', params)
}
// 新增
export function combinationAdd (params) {
  return http.post('/dataFactory/data/meta/data/combination/add', params)
}

// 数据域新增2（数据域+数据映射关系）
export function combinationAdd2 (params) {
  return http.post('/dataFactory/data/meta/data/combination/add2', params)
}

// 修改
export function combinationUpdate (params) {
  return http.post('/dataFactory/meta/data/combination/update', params)
}
// 删除元数据关系
export function combinationRelationshipDel (params) {
  return http.post('/dataFactory/meta/data/combination/relationship/delet', params)
}
// 新增元数据关系
export function combinationRelationshipAdd (params) {
  return http.post('/dataFactory/meta/data/combination/relationship/add', params)
}
// 查询元数据关系
export function combinationRelationshipDetail (params) {
  return http.post('/dataFactory/meta/data/combination/relationship/list', params)
}
// 数据任务列表
export function dataDomianProcessingList (params) {
  return http.post('dataFactory/data/processing/list', params)
}
// 数据域下数据
export function combinationData (params) {
  return http.post('/dataFactory/meta/data/combination/data', params)
}

// 数据任务
// 列表
export function processingList (params) {
  return http.post('dataFactory/data/processing/page', params)
}
// 元数据
export function dataRelationList (params) {
  return http.post('/dataFactory/data/relation/list', params)
}

// 元数据组合规则
// 删除
export function consanguinityDel (params) {
  return http.post('/dataFactory/meta/data/combination/consanguinity/delete', params)
}
// 列表
export function consanguinityList (params) {
  return http.post('/dataFactory/meta/data/combination/consanguinity/list', params)
}
// 新增
export function consanguinitySave (params) {
  return http.post('/dataFactory/meta/data/combination/consanguinity/save', params)
}
// 批量上传元数据-下载excel模板
export function downloadExcelTemplate () {
  return http.post('/dataFactory/download/excel')
}
// 批量上传元数据
export function uploadMetaDataFile (params) {
  return http.upload('/dataFactory/upload/excel', params)
}
// 导入数据域
export function combinationImport (params) {
  return http.upload('/dataFactory/meta/data/combination/import', params)
}
// 导出数据域
export function combinationExport () {
  return http.download('/dataFactory/meta/data/combination/export')
}

// 数据域-接入数据列表
export function getMongoPage (params) {
  return http.post('/dataFactory/platform/mongo/operate/page', params)
}

// 数据域-接入数据清空
export function getMongoClear (params) {
  return http.post('/dataFactory/platform/mongo/operate/clear', params)
}

// 数据映射关系保存
export function dataSourceSave (params) {
  return http.post('/dataFactory/meta/data/combination/data/sources/save', params)
}

// 数据映射关系列表
export function dataSourceList (params) {
  return http.post('/dataFactory/meta/data/combination/data/sources/list', params)
}

// 数据映射关系删除
export function dataSourceDelete (params) {
  return http.post('/dataFactory/meta/data/combination/data/sources/del', params)
}

// 数据映射关系详情
export function getDataSourceDetail (params) {
  return http.post('/dataFactory/meta/data/combination/data/sources/detail', params)
}

// 数据域类型字典
export function metaDataCombinationDict () {
  return http.post('/dataFactory/data/meta/data/combination/dict')
}

/* =========================================版本管理 ============================================= */
// 列表
export function snapshotList (params) {
  return http.post('/dataFactory/data/snapshot/list', params)
}

// 删除
export function snapshotDel (params) {
  return http.post('/dataFactory/data/snapshot/del', params)
}

// 修改快照名称和描述
export function snapshotUpdateDescribe (params) {
  return http.post('/dataFactory/data/snapshot/update/describe', params)
}

// 回滚快照
export function snapshotRollback (params) {
  return http.post('/dataFactory/data/snapshot/rollback', params)
}

// 创建快照
export function snapshotCreate (params) {
  return http.post('/dataFactory/data/snapshot/create', params)
}

// 类型字典
export function snapshotDict () {
  return http.post('/dataFactory/data/snapshot/update/dict')
}

/* =================================================== 数据视图(弃用) ============================================================= */
// 列表
export function viewList (params) {
  return http.post('/dataFactory/meta/data/combination/view/list', params)
}

// 删除
export function viewDel (params) {
  return http.post('/dataFactory/meta/data/combination/view/del', params)
}

// 新增、编辑
export function viewSave (params) {
  return http.post('/dataFactory/meta/data/combination/view/save', params)
}

// 详情
export function viewDetail (params) {
  return http.post('/dataFactory/meta/data/combination/view/detail', params)
}

// 数据依赖
export function combinationDependent (params) {
  return http.post('/dataFactory/meta/data/combination/dependent', params)
}
