Add getnodes
This commit is contained in:
11
main.py
11
main.py
@@ -72,15 +72,8 @@ async def fastapi_delete_project(network: str):
|
||||
|
||||
# element operations
|
||||
@app.get("/getnodes/")
|
||||
async def fastapi_get_nodes(network: str):
|
||||
nodeCount = get_count(network, NODE_COUNT)
|
||||
nodes = []
|
||||
for i in range(nodeCount.value):
|
||||
node_id = get_node_id(network, i + 1)
|
||||
if node_id.error_code == 0:
|
||||
nodes.append(node_id.value)
|
||||
|
||||
return nodes
|
||||
async def fastapi_get_nodes(network: str) -> list[str]:
|
||||
return get_nodes(network)
|
||||
|
||||
# junction
|
||||
@app.post("/addjunction/")
|
||||
|
||||
Reference in New Issue
Block a user