diff --git a/__pycache__/main.cpython-37.pyc b/__pycache__/main.cpython-37.pyc index 11524be..67f8557 100644 Binary files a/__pycache__/main.cpython-37.pyc and b/__pycache__/main.cpython-37.pyc differ diff --git a/main.py b/main.py index cc83b8d..07891c5 100644 --- a/main.py +++ b/main.py @@ -65,6 +65,28 @@ async def fastapi_count_node(network: str): print(count) 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) async def upload_inp(file: bytes = File(), name: str = None): filePath = inpDir + str(name)