Commit 88802b2a by qiuchaofei

新增接口:传入环境id,系统名,表名。返回表id

parent 3a94b92f
...@@ -310,4 +310,12 @@ public class RelationalGraphController { ...@@ -310,4 +310,12 @@ public class RelationalGraphController {
return schemaService.updateTagFromAllSchema(); return schemaService.updateTagFromAllSchema();
} }
//同步所有schema的标签
@ApiOperation(tags = "", value = "传入环境id,系统名,schema名,表名,获取表id")
@RequestMapping(path = "/getTableIdByEnvironmentSystemTableName", method = RequestMethod.GET)
public String getTableIdByEnvironmentSystemTableName(String environment,String system,String tableName){
logger.info("获取表id。");
return tableService.getTableId(environment,system,tableName);
}
} }
...@@ -18,4 +18,5 @@ public interface ITableService { ...@@ -18,4 +18,5 @@ public interface ITableService {
Map<String ,List<ReturnNode>> getchildrenByTableId(String tableId); Map<String ,List<ReturnNode>> getchildrenByTableId(String tableId);
String getTableId(String environment, String system, String tableName);
} }
...@@ -316,6 +316,16 @@ public class TableServiceImpl implements ITableService { ...@@ -316,6 +316,16 @@ public class TableServiceImpl implements ITableService {
return columnMap; return columnMap;
} }
@Override
public String getTableId(String environment, String system, String tableName) {
String metaId = "";
List<Neo4jTable> neo4jTables = neo4jTableRepository.findNeo4jTableByNameAndIsSystemAndIsEnvironment(tableName, system, environment);
if(neo4jTables!=null && neo4jTables.size()!=0){
metaId = neo4jTables.get(0).getMetadataId();
}
return metaId;
}
@Override @Override
public Map<String, List<ReturnNode>> getSourceAndTargetTableByTableId(String tableId) { public Map<String, List<ReturnNode>> getSourceAndTargetTableByTableId(String tableId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment