增加统一接口get_node_properties get_link_properties获取所有类型的属性值
This commit is contained in:
13
main.py
13
main.py
@@ -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]
|
||||
############################################################
|
||||
|
||||
Reference in New Issue
Block a user