- make realtime replacement and analysis result writes transactional\n- consolidate SCADA repositories and remove process-global project state\n- validate SCADA batches and use indexed GIS-backed business queries\n\nBREAKING CHANGE: remove the public analysis result writer and the pipeline-health network_name query parameter.
35 lines
1012 B
Python
35 lines
1012 B
Python
from typing import Any
|
|
|
|
from fastapi import APIRouter, Query
|
|
|
|
from app.services.tjnetwork import (
|
|
get_all_scada_info,
|
|
get_scada_info,
|
|
get_scada_info_schema,
|
|
)
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/network-schemas/scada-device", summary="获取 SCADA 设备结构")
|
|
def get_scada_device_schema(
|
|
network: str = Query(..., description="管网名称(或数据库名称)"),
|
|
) -> dict[str, dict[str, Any]]:
|
|
return get_scada_info_schema(network)
|
|
|
|
|
|
@router.get("/scada-devices", summary="获取 SCADA 设备列表")
|
|
def get_scada_devices(
|
|
network: str = Query(..., description="管网名称(或数据库名称)"),
|
|
) -> list[dict[str, Any]]:
|
|
return get_all_scada_info(network)
|
|
|
|
|
|
@router.get("/scada-devices/detail", summary="获取 SCADA 设备")
|
|
def get_scada_device(
|
|
network: str = Query(..., description="管网名称(或数据库名称)"),
|
|
device_id: str = Query(..., description="SCADA 设备 ID"),
|
|
) -> dict[str, Any]:
|
|
return get_scada_info(network, device_id)
|