2026-01-24 15:28:17 +08:00
|
|
|
from typing import Generic, Optional, TypeVar
|
2023-08-14 13:30:10 +08:00
|
|
|
|
2026-01-24 10:31:43 +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
|
|
|
|
|
|
|
|
|
2026-01-24 10:31:43 +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"
|
2026-01-24 15:28:17 +08:00
|
|
|
detail: Optional[T] = None
|