增加统一接口get_node_properties get_link_properties获取所有类型的属性值

This commit is contained in:
DingZQ
2025-02-05 20:37:50 +08:00
parent 83d73a96bd
commit cf335052cf
2 changed files with 29 additions and 0 deletions

13
main.py
View File

@@ -423,6 +423,19 @@ async def fastapi_get_patterns(network: str) -> list[str]:
def get_node_links(network: str, node: str) -> list[str]:
return get_node_links(network, node)
############################################################
# DingZQ, 2025-02-05
# 用统一的接口来获取 Node & Link properties, Node和Link的Id可以一样不能进一步统一成获取Element 的 properties
# Node & Link properties
############################################################
@app.get('/getnodeproperties/')
async def fast_get_node_properties(network: str, node: str) -> dict[str, Any]:
return get_node_properties(network, node)
@app.get('/getlinkproperties/')
async def fast_get_link_properties(network: str, link: str) -> dict[str, Any]:
return get_link_properties(network, link)
############################################################
# title 1.[TITLE]
############################################################