import request from "@/utils/request2";

// 信息系统管理
export function queryMisList(data) {
  return request({
    url: "/mis/queryMisList",
    method: "post",
    data: {
      ...data,
    },
  });
}

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

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

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

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

// 
export function getDirectoryAllLevel(data) {
  return request({
    url: 'directory/getDirectoryAllLevel',
    method: "post",
    data
  })
}

export function getResponsibilityList(data) {
  return request({
    url: '/responsibility/getResponsibilityList',
    method: "post",
    data
  })
}

// // 查询数据
export function addDatabase(data) {
  return request({
    url: '/database/addDatabase',
    method: "post",
    data: {
      ...data
    }
  })
}

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

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

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

// 目录管理

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

// 首页我的资产
export function queryCataLogPeople(data) {
  return request({
    url: '/catalog/queryCataLogPeople',
    method: "post",
    data: {
      ...data
    }
  })
}


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

export function removeCatalog(data) {
  return request({
    url: "/catalog/remove",
    method: "post",
    data: {
      ...data,
    },
  });
}

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

// 查询目录详情
export function getCatalogDetail(data) {
  return request({
    url: "/catalog/getCatalogDetail",
    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 updateCatalog(data) {
  return request({
    url: "/catalog/update",
    method: "post",
    data: {
      ...data,
    },
  });
}

// 目录分类
export function queryDirectoryList(data) {
  return request({
    url: '/directory/queryDirectoryList',
    method: "post",
    data: {
      ...data
    }
  })
}

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

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

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

export function queryDirectoryMsg(data) {
  return request({
    url: '/directory/queryDirectoryMsg',
    method: "post",
    data: {
      ...data,
    },
  });
}

// 标签树
export function getLableTree(data) {
  return request({
    url: 'label/getLableTree',
    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,
    },
  });
}


//归集列表查询
export function getImputationData(data) {
  return request({
    url: '/gaugeSet/queryByPage',
    method: "post",
    data: {
      ...data
    }
  })
}

// export function queryDataCascadingDetail(id) {
//   return request({
//     url: `/gaugeSet/queryById/${id}`,
//     methods: 'get'
//     // data: {
//     //   ...data
//     // }
//   })
// }

// export function queryDataCascadingDetail(id) {
//   return request({
//     url: `/gaugeSet/queryLogByPage`,
//     methods: 'get'
//     // data: {
//     //   ...data
//     // }
//   })
// }

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


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

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



// 预览
export function previewLog(data) {
  return request({
    url: '/gaugeSet/preview',
    method: "post",
    data: {
      ...data
    }
  })
}


// 元数据
export function addMeta(data) {
  return request({
    url: '/metaData/addMeta',
    method: "post",
    data: {
      ...data
    }
  })
}

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




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

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

export function deleteMeta(data) {
  return request({
    url: '/metaData/deleteMetas',
    method: "post",
    data: {
      ...data
    }
  })
}

// 适配器
export function addAdapter(data) {
  return request({
    url: '/metaData/capture/adapter/addAdapter',
    method: "post",
    data: {
      ...data
    }
  })
}

export function adapterList(data) {
  return request({
    url: '/metaData/capture/adapter/adapterList',
    method: "post",
    data: {
      ...data
    }
  })
}

export function adapterInfo(data) {
  return request({
    url: '/metaData/capture/adapter/adapterInfo',
    method: "post",
    data: {
      ...data
    }
  })
}

export function updateAdapter(data) {
  return request({
    url: '/metaData/capture/adapter/updateAdapter',
    method: "post",
    data: {
      ...data
    }
  })
}


export function toolList(data) {
  return request({
    url: '/metaData/capture/tool/toolList',
    method: "post",
    data: {
      ...data
    }
  })
}



// 任务配置
export function addApp(data) {
  return request({
    url: '/metaData/capture/app/addApp',
    method: "post",
    data: {
      ...data
    }
  })
}
export function appList(data) {
  return request({
    url: '/metaData/capture/app/appList',
    data: {
      ...data
    }
  })
}

export function updateApp(data) {
  return request({
    url: '/metaData/capture/app/updateApp',
    data: {
      ...data
    }
  })
}

export function deleteApp(data) {
  return request({
    url: '/metaData/capture/app/deleteApps',
    data: {
      ...data
    }
  })
}

export function exportApps(data) {
  return request({
    url: '/metaData/capture/app/exportApps',
    data: {
      ...data
    }
  })
}

// 手动采集
export function importApps(data) {
  return myRequestInstance({
    url: '/metaData/capture/import/importMetas',
    data: {
      ...data
    }
  })
}

export function exportTemp(data) {
  return request({
    url: '/metaData/capture/import/exportTemp',
    data: {
      ...data
    }
  })
}

export function xlxList(data) {
  return request({
    url: '/metaData/capture/import/xlxList',
    data: {
      ...data
    }
  })
}


export function deleteImport(data) {
  return request({
    url: '/metaData/capture/import/deleteImport',
    data: {
      ...data
    }
  })
}


// 采集日志
export function queryLogManagement(data) {
  return request({
    url: '/logManagement/queryLogManagement',
    data: {
      ...data
    }
  })
}

export function queryLogMsg(data) {
  return request({
    url: '/logManagement/queryLogMsg',
    data: {
      ...data
    }
  })
}


// 审核元数据
export function flowList(data) {
  return request({
    url: '/metaData/capture/flow/flowList',
    data: {
      ...data
    }
  })
}

export function addFlow(data) {
  return request({
    url: '/metaData/capture/flow/addFlow',
    data: {
      ...data
    }
  })
}


export function flowAudit(data) {
  return request({
    url: '/metaData/capture/flow/flowAudit',
    data: {
      ...data
    }
  })
}


export function flowInfoHistory(data) {
  return request({
    url: '/metaData/capture/flow/flowInfoHistory',
    data: {
      ...data
    }
  })

}
  export function testDbConnect(data) {
    return request({
      url: '/database/testDbConnect',
      data: {
        ...data
      }
    })
  }



// 共享申请
  export function applySharing(data) {
    return request({
      url: '/catalog/share',
      data: {
        ...data
      }
    })
}
  
  export function cancelShare(shareId) {
    return request({
      url: `catalog/cancelShare/${shareId}`,
      methods: 'get'
    })
  }