Fixed Add pipe error

This commit is contained in:
DingZQ
2022-10-16 11:27:27 +08:00
parent 2f6409e130
commit 469735d23f

View File

@@ -523,15 +523,16 @@ async def fast_get_pipe_schema(network: str) -> dict[str, dict[str, Any]]:
return get_pipe_schema(network)
@app.post("/addpipe/")
async def fastapi_add_pipe(network: str, pipe: str, node1: str, node2: str, length: float = 0, diameter: float = 0, roughness: float = 0, minorloss: float = 0, status: str = PIPE_STATUS_OPEN) -> ChangeSet:
async def fastapi_add_pipe(network: str, pipe: str, node1: str, node2: str, length: float = 0, diameter: float = 0, roughness: float = 0, minor_loss: float = 0, status: str = PIPE_STATUS_OPEN) -> ChangeSet:
ps = { 'id' : pipe,
'node1' : node1,
'node2' : node2,
'length' : length,
'diameter' : diameter,
'roughness' : roughness,
'minor_loss' : minorloss,
'status' : status }
'minor_loss' : minor_loss,
'status' : status
}
return add_pipe(network, ChangeSet(ps))
@app.post("/deletepipe/")