feat(api): standardize REST contracts and auth

This commit is contained in:
2026-07-30 20:38:51 +08:00
parent ae1a657554
commit ba947b616b
86 changed files with 54193 additions and 990 deletions
+1 -4
View File
@@ -11,7 +11,6 @@ from app.services.tjnetwork import (
router = APIRouter()
@router.get("/getjson/", summary="获取JSON示例", description="获取JSON格式响应示例")
async def fastapi_get_json():
"""
获取JSON示例
@@ -29,7 +28,6 @@ async def fastapi_get_json():
@router.get("/sensor-placement-schemes", summary="获取所有传感器位置", description="获取网络中所有传感器的放置位置信息")
@router.get("/getallsensorplacements/", summary="获取所有传感器位置(旧路径)", description="获取网络中所有传感器的放置位置信息", deprecated=True)
async def fastapi_get_all_sensor_placements(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[dict[Any, Any]]:
"""
获取所有传感器位置
@@ -39,7 +37,7 @@ async def fastapi_get_all_sensor_placements(network: str = Query(..., descriptio
return get_all_sensor_placements(network)
@router.get("/getallburstlocateresults/", summary="获取所有爆管定位结果", description="获取网络中所有爆管定位的分析结果")
@router.get("/burst-locations", summary="获取所有爆管定位结果", description="获取网络中所有爆管定位的分析结果")
async def fastapi_get_all_burst_locate_results(network: str = Query(..., description="管网名称(或数据库名称)")) -> list[dict[Any, Any]]:
"""
获取所有爆管定位结果
@@ -54,7 +52,6 @@ class Item(BaseModel):
str_info: str
@router.post("/test_dict/", summary="测试字典处理", description="测试处理字典类型数据")
async def fastapi_test_dict(data: Item) -> dict[str, str]:
"""
测试字典处理