modify: sophon 视频文件上传、告警接口

This commit is contained in:
2026-07-28 14:16:00 +08:00
parent 79eb7fe5cc
commit 320f6c19a2
17 changed files with 575 additions and 52 deletions
+37 -1
View File
@@ -8,6 +8,28 @@ from __future__ import annotations
from typing import Any, Optional
from pydantic import BaseModel, Field
class AlarmReportPostResponse(BaseModel):
"""告警上报接口 — 响应体"""
Result: dict[str, Any] = Field(...)
class GetAlarmGetRequest(BaseModel):
"""查询单条告警详情 — 请求体"""
alarm_id: str = Field(...)
class GetAlarmGetResponse(BaseModel):
"""查询单条告警详情 — 响应体"""
alarm_id: str = Field(...)
board_id: str = Field(...)
board_ip: str = Field(...)
summary: str = Field(...)
task_session: str = Field(...)
media_name: str = Field(...)
video_file: str = Field(...)
alarm_time: str = Field(...)
alarm_timestamp: int = Field(...)
alarm_data: dict[str, Any] = Field(...)
created_at: str = Field(...)
class GetDeviceGetRequest(BaseModel):
"""查询单个设备详情 — 请求体"""
board_id: str = Field(...)
@@ -24,6 +46,20 @@ class GetOfflineDevicesGetResponse(BaseModel):
offline_devices: list[dict] = Field(...)
total: int = Field(...)
class ListAlarmsGetRequest(BaseModel):
"""查询告警记录列表 — 请求体"""
board_id: str = Field(...)
summary: str = Field(...)
page: int = Field(...)
page_size: int = Field(...)
class ListAlarmsGetResponse(BaseModel):
"""查询告警记录列表 — 响应体"""
alarms: list[dict] = Field(...)
total: int = Field(...)
page: int = Field(...)
page_size: int = Field(...)
class ListDevicesGetResponse(BaseModel):
"""查询所有设备状态 — 响应体"""
devices: list[dict] = Field(...)
@@ -31,4 +67,4 @@ class ListDevicesGetResponse(BaseModel):
# 所有响应模型的联合类型
AiboxSophonAdapterResponse = ListDevicesGetResponse | GetOfflineDevicesGetResponse | GetDeviceGetResponse
AiboxSophonAdapterResponse = GetOfflineDevicesGetResponse | AlarmReportPostResponse | GetAlarmGetResponse | GetDeviceGetResponse | ListAlarmsGetResponse | ListDevicesGetResponse