更新参数名;更新引用类

This commit is contained in:
JIANG
2025-12-18 14:50:29 +08:00
parent 971386ae5a
commit 2b268081b1
3 changed files with 8 additions and 12 deletions

View File

@@ -599,7 +599,7 @@ async def clean_scada_data(
@router.get("/composite/pipeline-health-prediction")
async def predict_pipeline_health(
query_time: datetime = Query(..., description="查询时间"),
db_name: str = Query(..., description="管网数据库名称"),
network_name: str = Query(..., description="管网数据库名称"),
timescale_conn: AsyncConnection = Depends(get_database_connection),
):
"""
@@ -616,14 +616,9 @@ async def predict_pipeline_health(
预测结果列表,每个元素包含 link_id 和对应的生存函数
"""
try:
result = await CompositeQueries.predict_pipeline_health(
timescale_conn, db_name, query_time
return await CompositeQueries.predict_pipeline_health(
timescale_conn, network_name, query_time
)
return {
"success": True,
"result": result,
}
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e))
except FileNotFoundError as e: