Pass junction id to junction set methods
This commit is contained in:
6
main.py
6
main.py
@@ -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:
|
||||
props = {}
|
||||
props['elevation'] = elevation
|
||||
props['id'] = junction
|
||||
return set_junction(network, junction, props)
|
||||
|
||||
@app.post("/setjunctionx/")
|
||||
async def fastapi_set_junction_x(network: str, junction: str, x: float) -> ChangeSet:
|
||||
props = {}
|
||||
props['x'] = x
|
||||
props['id'] = junction
|
||||
return set_junction(network, junction, props)
|
||||
|
||||
@app.post("/setjunctionx/")
|
||||
async def fastapi_set_junction_y(network: str, junction: str, y: float) -> ChangeSet:
|
||||
props = {}
|
||||
props['y'] = y
|
||||
props['id'] = junction
|
||||
return set_junction(network, junction, props)
|
||||
|
||||
@app.post("/setjunctioncoord/")
|
||||
@@ -226,18 +229,21 @@ async def fastapi_set_junction_coord(network: str, junction: str, x, float, y: f
|
||||
props = {}
|
||||
props['x'] = x
|
||||
props['y'] = y
|
||||
props['id'] = junction
|
||||
return set_junction(network, junction, props)
|
||||
|
||||
@app.post("/setjunctiondemand/")
|
||||
async def fastapi_set_junction_demand(network: str, junction: str, demand: float) -> ChangeSet:
|
||||
props = {}
|
||||
props['demand'] = demand
|
||||
props['id'] = junction
|
||||
return set_junction(network, junction, props)
|
||||
|
||||
@app.post("/setjunctionpattern/")
|
||||
async def fastapi_set_junction_pattern(network: str, junction: str, pattern: str) -> ChangeSet:
|
||||
props = {}
|
||||
props['pattern'] = pattern
|
||||
props['id'] = junction
|
||||
return set_junction(network, junction, props)
|
||||
|
||||
@app.get("/getjunctionproperties/")
|
||||
|
||||
Reference in New Issue
Block a user