modify: 上报接口 422 问题

This commit is contained in:
2026-07-28 15:35:45 +08:00
parent 32f092e59c
commit 4d6ad2eae2
2 changed files with 11 additions and 5 deletions
+2 -2
View File
@@ -116,8 +116,8 @@ async def alarm_report(body: AlarmReportRequest) -> AlarmReportResponse:
返回格式:{"Result": {"Code": 0, "Desc": ""}}
仅当 HTTP 200 + Code 非 0 时,盒子认为上报失败。
"""
# 获取完整报文(含 extra 字段)
full_data = body.model_dump()
# 获取完整报文(含 extra 字段,排除 None 值以生成整洁 JSON)
full_data = body.model_dump(exclude_none=True)
board_id = full_data.get("BoardId", "")
board_ip = full_data.get("BoardIp", "")