From f96d692dd9d133d4dccb1590aa7ef0c6e5c35746 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Fri, 27 Mar 2026 11:09:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9AEdgeAlarmReport=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20area=5Fid=20=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E5=88=9B=E5=BB=BA=E6=97=B6=E4=BC=98=E5=85=88?= =?UTF-8?q?=E4=BB=8E=E9=A1=B6=E5=B1=82=E5=8F=96=20area=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/schemas.py | 1 + app/services/alarm_event_service.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/schemas.py b/app/schemas.py index d93de8a..4710bff 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -124,6 +124,7 @@ class EdgeAlarmReport(BaseModel): snapshot_url: Optional[str] = Field(None, max_length=512, description="截图 COS object_key") algorithm_code: Optional[str] = Field(None, max_length=64, description="算法编码") confidence_score: Optional[float] = Field(None, ge=0, le=1, description="置信度 0-1") + area_id: Optional[int] = Field(None, description="区域ID") ext_data: Optional[Dict[str, Any]] = Field(None, description="扩展数据 (bbox/target_class 等)") diff --git a/app/services/alarm_event_service.py b/app/services/alarm_event_service.py index ca70f9c..5c2a0c8 100644 --- a/app/services/alarm_event_service.py +++ b/app/services/alarm_event_service.py @@ -240,7 +240,7 @@ class AlarmEventService: handle_status="UNHANDLED", snapshot_url=data.get("snapshot_url"), edge_node_id=ext_data.get("edge_node_id"), - area_id=ext_data.get("area_id"), + area_id=data.get("area_id") or ext_data.get("area_id"), ) db.add(alarm)