Add API to get all node properties
This commit is contained in:
17
main.py
17
main.py
@@ -649,6 +649,13 @@ async def fastapi_set_junction_pattern(network: str, junction: str, pattern: str
|
||||
async def fastapi_get_junction_properties(network: str, junction: str) -> dict[str, Any]:
|
||||
return get_junction(network, junction)
|
||||
|
||||
# DingZQ, 2025-03-29
|
||||
@app.get("/getalljunctionproperties/")
|
||||
async def fastapi_get_all_junction_properties(network: str) -> list[dict[str, Any]]:
|
||||
return get_all_junctions(network)
|
||||
|
||||
|
||||
|
||||
@app.post("/setjunctionproperties/",response_model=None)
|
||||
async def fastapi_set_junction_properties(network: str, junction: str, req: Request) -> ChangeSet:
|
||||
props = await req.json()
|
||||
@@ -738,6 +745,11 @@ async def fastapi_set_reservoir_y(network: str, reservoir: str, x: float, y: flo
|
||||
async def fastapi_get_reservoir_properties(network: str, reservoir: str) -> dict[str, Any]:
|
||||
return get_reservoir(network, reservoir)
|
||||
|
||||
# DingZQ, 2025-03-29
|
||||
@app.get("/getallreservoirproperties/")
|
||||
async def fastapi_get_all_reservoir_properties(network: str) -> list[dict[str, Any]]:
|
||||
return get_all_reservoirs(network)
|
||||
|
||||
@app.post("/setreservoirproperties/",response_model=None)
|
||||
async def fastapi_set_reservoir_properties(network: str, reservoir: str
|
||||
, req: Request) -> ChangeSet:
|
||||
@@ -900,6 +912,11 @@ async def fastapi_set_tank_coord(network: str, tank: str, x: float, y: float) ->
|
||||
async def fastapi_get_tank_properties(network: str, tank: str) -> dict[str, Any]:
|
||||
return get_tank(network, tank)
|
||||
|
||||
# DingZQ, 2025-03-29
|
||||
@app.get("/getalltankproperties/")
|
||||
async def fastapi_get_all_tank_properties(network: str) -> list[dict[str, Any]]:
|
||||
return get_all_tanks(network)
|
||||
|
||||
@app.post("/settankproperties/",response_model=None)
|
||||
async def fastapi_set_tank_properties(network: str, tank: str, req: Request) -> ChangeSet:
|
||||
props = await req.json()
|
||||
|
||||
Reference in New Issue
Block a user