Files
yaoyaoai/app/schemas/common.py
fengchuanhn@gmail.com cccd75767b 11
2026-05-15 18:52:29 +08:00

16 lines
317 B
Python

from typing import Generic, TypeVar
from pydantic import BaseModel, ConfigDict
T = TypeVar("T")
class ApiResponse(BaseModel, Generic[T]):
"""与 aiclient 前端约定的统一响应结构。"""
model_config = ConfigDict(from_attributes=True)
ok: bool
message: str = ""
data: T | None = None