.
This commit is contained in:
@@ -106,8 +106,18 @@ public class MetadataService extends BaseService { //arango
|
||||
}
|
||||
|
||||
@RestMapping(name = "tableinfo", comment = "table详情")
|
||||
public JBean tableInfo(@RestParam(name = "platToken") String token, String name) {
|
||||
return JBean.by(0, "", findMetaTable(name, token));
|
||||
public JBean tableInfo(@RestParam(name = "platToken") String token, String name, String alias) {
|
||||
JBean jBean = new JBean();
|
||||
|
||||
MetaTable metaTable = null;
|
||||
if (!isEmpty.test(name)) {
|
||||
metaTable = findMetaTable(name, token);
|
||||
}
|
||||
if (metaTable == null && !isEmpty.test(alias)) {
|
||||
metaTable = MetaKit.getMetaTableByAlias(alias);
|
||||
}
|
||||
|
||||
return jBean.setBody(metaTable);
|
||||
}
|
||||
|
||||
@RestMapping(name = "service_info", comment = "service基本信息")
|
||||
@@ -226,6 +236,26 @@ public class MetadataService extends BaseService { //arango
|
||||
return jBean.setBody(list);
|
||||
}
|
||||
|
||||
|
||||
@RestMapping(name = "link_info", comment = "关联信息")
|
||||
public JBean linkInfo(String alias) {
|
||||
JBean jBean = new JBean();
|
||||
//MetaTable metaTable = MetaKit.getMetaTableByAlias(alias);
|
||||
List<Kv> list = MetaKit.getMetaLinks().stream().filter(x ->
|
||||
x.getTables()[0].equals(alias) || x.getTables()[0].equals(alias)
|
||||
).map(x -> {
|
||||
MetaTable linkTable = MetaKit.getMetaTableByAlias(x.getTables()[0].equals(alias) ? x.getTables()[1] : x.getTables()[0]);
|
||||
Kv kv = Kv.of("name", linkTable.getName())
|
||||
.set("alias", linkTable.getAlias())
|
||||
.set("comment", linkTable.getComment())
|
||||
.set("linkSize", x.getLink().size())
|
||||
.set("link", x.getLink());
|
||||
return kv;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return jBean.setBody(list);
|
||||
}
|
||||
|
||||
@RestMapping(name = "link_list", comment = "实体关系列表")
|
||||
public JBean linkList() {
|
||||
JBean jBean = new JBean();
|
||||
|
||||
Reference in New Issue
Block a user