Update main.py
This commit is contained in:
Binary file not shown.
19
main.py
19
main.py
@@ -40,6 +40,10 @@ async def fastapi_redo(network: str):
|
||||
|
||||
return True
|
||||
|
||||
@app.get("/haveproject/")
|
||||
async def fastapi_have_project(network: str):
|
||||
return have_project(network)
|
||||
|
||||
@app.post("/createproject/")
|
||||
async def fastapi_create_project(network: str):
|
||||
create_project(network)
|
||||
@@ -48,6 +52,16 @@ async def fastapi_create_project(network: str):
|
||||
print(network)
|
||||
return network
|
||||
|
||||
@app.post("/closeproject/")
|
||||
async def fastapi_close_project(network: str):
|
||||
close_project(network)
|
||||
return True
|
||||
|
||||
@app.post("/deleteproject/")
|
||||
async def fastapi_delete_project(network: str):
|
||||
delete_project(network)
|
||||
return True
|
||||
|
||||
@app.get("/getnodes/")
|
||||
async def fastapi_get_nodes(network: str):
|
||||
nodeCount = get_count(network, NODE_COUNT)
|
||||
@@ -63,6 +77,9 @@ async def fastapi_get_nodes(network: str):
|
||||
async def fastapi_add_node(network: str, node: str):
|
||||
idx = add_node(network, node, JUNCTION)
|
||||
print(idx)
|
||||
print("add node")
|
||||
count = get_count(network, NODE_COUNT)
|
||||
print(count.value)
|
||||
return idx
|
||||
|
||||
@app.post("/deletenode/")
|
||||
@@ -133,3 +150,5 @@ async def download_inp(name: str, response: Response):
|
||||
else:
|
||||
response.status_code = status.HTTP_400_BAD_REQUEST
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user