Refine addjunciton and deletejunction

This commit is contained in:
DingZQ
2022-10-15 09:16:37 +08:00
parent 17e70bb0a3
commit 4a6cdb9d07

View File

@@ -164,11 +164,13 @@ async def fast_get_junction_schema(network: str) -> dict[str, dict[str, Any]]:
@app.post("/addjunction/")
async def fastapi_add_junction(network: str, junction: str, x: float, y: float, z: float) -> ChangeSet:
return add_junction(network, junction, x, y, z)
cs = {'id' : network, 'x' : x, 'y' : y, 'elevation' : z}
return add_junction(network, cs)
@app.post("/deletejunction/")
async def fastapi_delete_junction(network: str, junction: str) -> ChangeSet:
return delete_junction(network, junction)
cs = {'id' : junction}
return delete_junction(network, cs)
@app.get("/getjunctionelevation/")
async def fastapi_get_junction_elevation(network: str, junction: str) -> float: