This commit is contained in:
DingZQ
2023-09-20 00:12:58 +08:00
parent d2d2948285
commit 0de74cc892

13
main.py
View File

@@ -66,7 +66,7 @@ async def fastapi_list_projects() -> list[str]:
return list_project()
@app.get("/haveproject/")
async def fastapi_have_project(network: str):
sync def fastapi_have_project(network: str):
return have_project(network)
@app.post("/createproject/")
@@ -799,9 +799,14 @@ async def fastapi_set_pipe_minor_loss(network: str, pipe: str, minor_loss: float
async def fastapi_set_pipe_status(network: str, pipe: str, status: str) -> ChangeSet:
ps = { 'id' : pipe,
'status' : status }
ret = set_pipe(network, ChangeSet(ps))
print(ret)
return ret
print(status)
print(ps)
#ret = set_pipe(network, ChangeSet(ps))
#print(ret)
#return ret
return status
@app.get("/getpipeproperties/")
async def fastapi_get_pipe_properties(network: str, pipe: str) -> dict[str, Any]: