Files

11 lines
215 B
Python
Raw Permalink Normal View History

from typing import Generic, Optional, TypeVar
2023-08-14 13:30:10 +08:00
from pydantic import BaseModel
2023-08-14 13:30:10 +08:00
2025-02-15 22:00:53 +08:00
T = TypeVar("T")
2023-08-14 13:30:10 +08:00
class APIResponse(BaseModel, Generic[T]):
2023-08-14 13:30:10 +08:00
code: int = 200
2025-02-15 22:00:53 +08:00
message: str = "ok"
detail: Optional[T] = None