Files
chongming-plugins/aibox_sophon_adapter/models/pydantic.py
T

71 lines
2.2 KiB
Python
Raw Normal View History

2026-07-27 14:28:07 +08:00
"""
自动生成的 Pydantic 模型 — aibox_sophon_adapter
来源: config/workers/aibox_sophon_adapter/
"""
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(...)
2026-07-27 14:28:07 +08:00
class GetDeviceGetRequest(BaseModel):
"""查询单个设备详情 — 请求体"""
board_id: str = Field(...)
class GetDeviceGetResponse(BaseModel):
"""查询单个设备详情 — 响应体"""
board_id: str = Field(...)
is_online: bool = Field(...)
last_ping_time: Optional[str] = Field(default=None)
ping_data: Optional[dict[str, Any]] = Field(default=None)
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(...)
2026-07-27 14:28:07 +08:00
class ListDevicesGetResponse(BaseModel):
"""查询所有设备状态 — 响应体"""
devices: list[dict] = Field(...)
total: int = Field(...)
# 所有响应模型的联合类型
AiboxSophonAdapterResponse = GetOfflineDevicesGetResponse | AlarmReportPostResponse | GetAlarmGetResponse | GetDeviceGetResponse | ListAlarmsGetResponse | ListDevicesGetResponse