整理 api tags
This commit is contained in:
@@ -8,8 +8,7 @@ from .dependencies import get_timescale_connection, get_postgres_connection
|
|||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|
||||||
@router.get("/composite/scada-simulation", summary="获取SCADA关联的模拟数据",
|
@router.get("/composite/scada-simulation", summary="获取SCADA关联的模拟数据")
|
||||||
tags=["复合查询"])
|
|
||||||
async def get_scada_associated_simulation_data(
|
async def get_scada_associated_simulation_data(
|
||||||
start_time: datetime = Query(..., description="查询开始时间"),
|
start_time: datetime = Query(..., description="查询开始时间"),
|
||||||
end_time: datetime = Query(..., description="查询结束时间"),
|
end_time: datetime = Query(..., description="查询结束时间"),
|
||||||
@@ -74,8 +73,7 @@ async def get_scada_associated_simulation_data(
|
|||||||
raise HTTPException(status_code=400, detail=str(e))
|
raise HTTPException(status_code=400, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
@router.get("/composite/element-simulation", summary="获取管网元素的模拟数据",
|
@router.get("/composite/element-simulation", summary="获取管网元素的模拟数据")
|
||||||
tags=["复合查询"])
|
|
||||||
async def get_feature_simulation_data(
|
async def get_feature_simulation_data(
|
||||||
start_time: datetime = Query(..., description="查询开始时间"),
|
start_time: datetime = Query(..., description="查询开始时间"),
|
||||||
end_time: datetime = Query(..., description="查询结束时间"),
|
end_time: datetime = Query(..., description="查询结束时间"),
|
||||||
@@ -145,8 +143,7 @@ async def get_feature_simulation_data(
|
|||||||
raise HTTPException(status_code=400, detail=str(e))
|
raise HTTPException(status_code=400, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
@router.get("/composite/element-scada", summary="获取管网元素关联的SCADA监测数据",
|
@router.get("/composite/element-scada", summary="获取管网元素关联的SCADA监测数据")
|
||||||
tags=["复合查询"])
|
|
||||||
async def get_element_associated_scada_data(
|
async def get_element_associated_scada_data(
|
||||||
element_id: str = Query(..., description="管网元素ID(管道或节点)"),
|
element_id: str = Query(..., description="管网元素ID(管道或节点)"),
|
||||||
start_time: datetime = Query(..., description="查询开始时间"),
|
start_time: datetime = Query(..., description="查询开始时间"),
|
||||||
@@ -188,8 +185,7 @@ async def get_element_associated_scada_data(
|
|||||||
raise HTTPException(status_code=400, detail=str(e))
|
raise HTTPException(status_code=400, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
@router.post("/composite/clean-scada", summary="清洗SCADA监测数据",
|
@router.post("/composite/clean-scada", summary="清洗SCADA监测数据")
|
||||||
tags=["复合查询"])
|
|
||||||
async def clean_scada_data(
|
async def clean_scada_data(
|
||||||
device_ids: str = Query(..., description="设备ID列表或 'all' 表示清洗所有设备"),
|
device_ids: str = Query(..., description="设备ID列表或 'all' 表示清洗所有设备"),
|
||||||
start_time: datetime = Query(..., description="清洗数据的开始时间"),
|
start_time: datetime = Query(..., description="清洗数据的开始时间"),
|
||||||
@@ -232,8 +228,7 @@ async def clean_scada_data(
|
|||||||
raise HTTPException(status_code=400, detail=str(e))
|
raise HTTPException(status_code=400, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
@router.get("/composite/pipeline-health-prediction", summary="预测管道健康状况",
|
@router.get("/composite/pipeline-health-prediction", summary="预测管道健康状况")
|
||||||
tags=["复合查询"])
|
|
||||||
async def predict_pipeline_health(
|
async def predict_pipeline_health(
|
||||||
query_time: datetime = Query(..., description="查询时间"),
|
query_time: datetime = Query(..., description="查询时间"),
|
||||||
network_name: str = Query(..., description="管网名称(或数据库名称)"),
|
network_name: str = Query(..., description="管网名称(或数据库名称)"),
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ api_router = APIRouter()
|
|||||||
|
|
||||||
# Core Services
|
# Core Services
|
||||||
api_router.include_router(auth.router, prefix="/auth", tags=["Auth"])
|
api_router.include_router(auth.router, prefix="/auth", tags=["Auth"])
|
||||||
api_router.include_router(user_management.router, prefix="/users", tags=["User Management"]) # 新增
|
api_router.include_router(
|
||||||
|
user_management.router, prefix="/users", tags=["User Management"]
|
||||||
|
) # 新增
|
||||||
api_router.include_router(audit.router, prefix="/audit", tags=["Audit Logs"]) # 新增
|
api_router.include_router(audit.router, prefix="/audit", tags=["Audit Logs"]) # 新增
|
||||||
api_router.include_router(meta.router, tags=["Metadata"])
|
api_router.include_router(meta.router, tags=["Metadata"])
|
||||||
api_router.include_router(project.router, tags=["Project"])
|
api_router.include_router(project.router, tags=["Project"])
|
||||||
@@ -84,8 +86,8 @@ api_router.include_router(visuals.router, tags=["Visuals"])
|
|||||||
|
|
||||||
# Simulation & Data
|
# Simulation & Data
|
||||||
api_router.include_router(simulation.router, tags=["Simulation Control"])
|
api_router.include_router(simulation.router, tags=["Simulation Control"])
|
||||||
api_router.include_router(data_query.router, tags=["Data Query & InfluxDB"])
|
# api_router.include_router(data_query.router, tags=["Data Query & InfluxDB"])
|
||||||
api_router.include_router(scada.router, tags=["SCADA"])
|
api_router.include_router(scada.router)
|
||||||
api_router.include_router(snapshots.router, tags=["Snapshots"])
|
api_router.include_router(snapshots.router, tags=["Snapshots"])
|
||||||
api_router.include_router(users.router, tags=["Users"])
|
api_router.include_router(users.router, tags=["Users"])
|
||||||
api_router.include_router(schemes.router, tags=["Schemes"])
|
api_router.include_router(schemes.router, tags=["Schemes"])
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ app = FastAPI(
|
|||||||
# Include Routers
|
# Include Routers
|
||||||
app.include_router(api_router, prefix="/api/v1")
|
app.include_router(api_router, prefix="/api/v1")
|
||||||
# Legcy Routers without version prefix
|
# Legcy Routers without version prefix
|
||||||
app.include_router(api_router)
|
# app.include_router(api_router)
|
||||||
|
|
||||||
# 配置中间件
|
# 配置中间件
|
||||||
app.add_middleware(GZipMiddleware, minimum_size=1000)
|
app.add_middleware(GZipMiddleware, minimum_size=1000)
|
||||||
|
|||||||
Reference in New Issue
Block a user