Add API get network link nodes
This commit is contained in:
7
main.py
7
main.py
@@ -1391,6 +1391,7 @@ async def fastapi_set_option_properties(network: str, req: Request) -> ChangeSet
|
||||
async def fastapi_get_node_coord(network: str, node: str) -> dict[str, float] | None:
|
||||
return get_node_coord(network, node)
|
||||
|
||||
# DingZQ, 2024-12-08, get all node coord
|
||||
@app.get("/getnetworkcoords/")
|
||||
async def fastapi_get_network_coords(network: str) -> list[str] | None:
|
||||
coords = get_network_coords(network)
|
||||
@@ -1399,6 +1400,12 @@ async def fastapi_get_network_coords(network: str) -> list[str] | None:
|
||||
result.append(f"{node_id}:{coord['x']}:{coord['y']}")
|
||||
return result
|
||||
|
||||
# DingZQ, 2024-12-08, get all links' start and end node
|
||||
# link_id:node_id1:node_id2
|
||||
@app.get("/getnetworklinknodes/")
|
||||
async def fastapi_get_network_link_nodes(network: str) -> list[str] | None:
|
||||
return get_network_link_nodes(network)
|
||||
|
||||
############################################################
|
||||
# vertex 25.[VERTICES]
|
||||
############################################################
|
||||
|
||||
Reference in New Issue
Block a user