Refine
This commit is contained in:
10
main.py
10
main.py
@@ -1708,11 +1708,17 @@ async def fastapi_generate_virtual_district(network: str, req: Request) -> Chang
|
||||
# water_distribution_area 36
|
||||
############################################################
|
||||
@app.get('/calculatedemandtonodes/')
|
||||
async def fastapi_calculate_demand_to_nodes(network: str, demand: float, nodes: list[str]) -> dict[str, float]:
|
||||
async def fastapi_calculate_demand_to_nodes(network: str, req: Request) -> dict[str, float]:
|
||||
props = await req.json()
|
||||
demand = props['demand']
|
||||
nodes = props['nodes']
|
||||
return calculate_demand_to_nodes(network, demand, nodes)
|
||||
|
||||
@app.get('/calculatedemandtoregion/')
|
||||
async def fastapi_calculate_demand_to_region(network: str, demand: float, region: str) -> dict[str, float]:
|
||||
async def fastapi_calculate_demand_to_region(network: str, req: Request) -> dict[str, float]:
|
||||
props = await req.json()
|
||||
demand = props['demand']
|
||||
region = props['region']
|
||||
return calculate_demand_to_region(network, demand, region)
|
||||
|
||||
@app.get('/calculatedemandtonetwork/')
|
||||
|
||||
Reference in New Issue
Block a user