Refine
This commit is contained in:
14
main.py
14
main.py
@@ -50,6 +50,12 @@ async def fastapi_have_project(network: str):
|
|||||||
@app.post("/createproject/")
|
@app.post("/createproject/")
|
||||||
async def fastapi_create_project(network: str):
|
async def fastapi_create_project(network: str):
|
||||||
create_project(network)
|
create_project(network)
|
||||||
|
|
||||||
|
print(network)
|
||||||
|
return network
|
||||||
|
|
||||||
|
@app.post("/openproject/")
|
||||||
|
async def fastapi_open_project(network: str):
|
||||||
open_project(network)
|
open_project(network)
|
||||||
|
|
||||||
print(network)
|
print(network)
|
||||||
@@ -70,8 +76,8 @@ async def fastapi_delete_project(network: str):
|
|||||||
async def fastapi_get_nodes(network: str):
|
async def fastapi_get_nodes(network: str):
|
||||||
nodeCount = get_count(network, NODE_COUNT)
|
nodeCount = get_count(network, NODE_COUNT)
|
||||||
nodes = []
|
nodes = []
|
||||||
for i in range(0, nodeCount.value + 1):
|
for i in range(nodeCount.value):
|
||||||
node_id = get_node_id(network, i)
|
node_id = get_node_id(network, i + 1)
|
||||||
if node_id.error_code == 0:
|
if node_id.error_code == 0:
|
||||||
nodes.append(node_id.value)
|
nodes.append(node_id.value)
|
||||||
|
|
||||||
@@ -128,8 +134,8 @@ async def fastapi_set_node_coord(network: str, node: str, x: int, y: int):
|
|||||||
async def fastapi_get_links(network: str):
|
async def fastapi_get_links(network: str):
|
||||||
linkCount = get_count(network, LINK_COUNT)
|
linkCount = get_count(network, LINK_COUNT)
|
||||||
links = []
|
links = []
|
||||||
for i in range(1, linkCount.value + 1):
|
for i in range(linkCount.value):
|
||||||
link_id = get_link_id(network, i)
|
link_id = get_link_id(network, i + 1)
|
||||||
if link_id.error_code == 0:
|
if link_id.error_code == 0:
|
||||||
links.append(link_id.value)
|
links.append(link_id.value)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user