Add link
This commit is contained in:
Binary file not shown.
22
main.py
22
main.py
@@ -65,6 +65,28 @@ async def fastapi_count_node(network: str):
|
|||||||
print(count)
|
print(count)
|
||||||
return count.value
|
return count.value
|
||||||
|
|
||||||
|
@app.post("/setnodecoord/")
|
||||||
|
async def fastapi_set_node_coord(network: str, node: str, x: int, y: int):
|
||||||
|
set_node_coord(network, node, x, y)
|
||||||
|
return True
|
||||||
|
|
||||||
|
@app.post("/addlink/")
|
||||||
|
async def fastapi_add_link(network: str, link: str, fromNode: str, toNode: str):
|
||||||
|
idx = add_link(network, link, PIPE, fromNode, toNode)
|
||||||
|
print(idx)
|
||||||
|
return idx
|
||||||
|
|
||||||
|
@app.post("/deletelink/")
|
||||||
|
async def fastapi_delete_link(network: str, link: str):
|
||||||
|
delete_link(network, link)
|
||||||
|
return True
|
||||||
|
|
||||||
|
@app.get("/countlink/")
|
||||||
|
async def fastapi_count_link(network: str):
|
||||||
|
count = get_count(network, LINK_COUNT)
|
||||||
|
print(count)
|
||||||
|
return count.value
|
||||||
|
|
||||||
@app.post("/uploadinp/", status_code=status.HTTP_200_OK)
|
@app.post("/uploadinp/", status_code=status.HTTP_200_OK)
|
||||||
async def upload_inp(file: bytes = File(), name: str = None):
|
async def upload_inp(file: bytes = File(), name: str = None):
|
||||||
filePath = inpDir + str(name)
|
filePath = inpDir + str(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user