Pass junction id to junction set methods

This commit is contained in:
DingZQ
2022-10-15 14:34:57 +08:00
parent 9834d2b1ea
commit 848f713848

View File

@@ -207,18 +207,21 @@ async def fastapi_get_junction_pattern(network: str, junction: str) -> str:
async def fastapi_set_junction_elevation(network: str, junction: str, elevation: float) -> ChangeSet: async def fastapi_set_junction_elevation(network: str, junction: str, elevation: float) -> ChangeSet:
props = {} props = {}
props['elevation'] = elevation props['elevation'] = elevation
props['id'] = junction
return set_junction(network, junction, props) return set_junction(network, junction, props)
@app.post("/setjunctionx/") @app.post("/setjunctionx/")
async def fastapi_set_junction_x(network: str, junction: str, x: float) -> ChangeSet: async def fastapi_set_junction_x(network: str, junction: str, x: float) -> ChangeSet:
props = {} props = {}
props['x'] = x props['x'] = x
props['id'] = junction
return set_junction(network, junction, props) return set_junction(network, junction, props)
@app.post("/setjunctionx/") @app.post("/setjunctionx/")
async def fastapi_set_junction_y(network: str, junction: str, y: float) -> ChangeSet: async def fastapi_set_junction_y(network: str, junction: str, y: float) -> ChangeSet:
props = {} props = {}
props['y'] = y props['y'] = y
props['id'] = junction
return set_junction(network, junction, props) return set_junction(network, junction, props)
@app.post("/setjunctioncoord/") @app.post("/setjunctioncoord/")
@@ -226,18 +229,21 @@ async def fastapi_set_junction_coord(network: str, junction: str, x, float, y: f
props = {} props = {}
props['x'] = x props['x'] = x
props['y'] = y props['y'] = y
props['id'] = junction
return set_junction(network, junction, props) return set_junction(network, junction, props)
@app.post("/setjunctiondemand/") @app.post("/setjunctiondemand/")
async def fastapi_set_junction_demand(network: str, junction: str, demand: float) -> ChangeSet: async def fastapi_set_junction_demand(network: str, junction: str, demand: float) -> ChangeSet:
props = {} props = {}
props['demand'] = demand props['demand'] = demand
props['id'] = junction
return set_junction(network, junction, props) return set_junction(network, junction, props)
@app.post("/setjunctionpattern/") @app.post("/setjunctionpattern/")
async def fastapi_set_junction_pattern(network: str, junction: str, pattern: str) -> ChangeSet: async def fastapi_set_junction_pattern(network: str, junction: str, pattern: str) -> ChangeSet:
props = {} props = {}
props['pattern'] = pattern props['pattern'] = pattern
props['id'] = junction
return set_junction(network, junction, props) return set_junction(network, junction, props)
@app.get("/getjunctionproperties/") @app.get("/getjunctionproperties/")