11
This commit is contained in:
15
app/schemas/common.py
Normal file
15
app/schemas/common.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user