modify: 上报接口 422 问题
This commit is contained in:
@@ -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", "")
|
||||
|
||||
Reference in New Issue
Block a user