修复丢失的api;重新规划api结构
This commit is contained in:
@@ -30,5 +30,26 @@ async def fastapi_set_demand_properties(
|
||||
############################################################
|
||||
# water distribution 36.[Water Distribution]
|
||||
############################################################
|
||||
# This section was empty in main.py, so skipping unless found elsewhere or needed.
|
||||
# If there are specific Water Distribution endpoints they should go here.
|
||||
@router.get("/calculatedemandtonodes/")
|
||||
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)
|
||||
|
||||
@router.get("/calculatedemandtoregion/")
|
||||
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)
|
||||
|
||||
@router.get("/calculatedemandtonetwork/")
|
||||
async def fastapi_calculate_demand_to_network(
|
||||
network: str, demand: float
|
||||
) -> dict[str, float]:
|
||||
return calculate_demand_to_network(network, demand)
|
||||
|
||||
Reference in New Issue
Block a user