Files

15 lines
307 B
Python
Raw Permalink Normal View History

2023-08-14 13:30:10 +08:00
# @Time : 2023/8/14 11:48
# @Author : Lan
# @File : response.py
# @Software: PyCharm
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