35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
"""
|
|||
|
|
自动生成的 Pydantic 模型 — aibox_sophon_adapter
|
||
|
|
来源: config/workers/aibox_sophon_adapter/
|
||
|
|
"""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typing import Any, Optional
|
||
|
|
from pydantic import BaseModel, Field
|
||
|
|
|
||
|
|
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 ListDevicesGetResponse(BaseModel):
|
||
|
|
"""查询所有设备状态 — 响应体"""
|
||
|
|
devices: list[dict] = Field(...)
|
||
|
|
total: int = Field(...)
|
||
|
|
|
||
|
|
|
||
|
|
# 所有响应模型的联合类型
|
||
|
|
AiboxSophonAdapterResponse = ListDevicesGetResponse | GetOfflineDevicesGetResponse | GetDeviceGetResponse
|