56 lines
944 B
Python
56 lines
944 B
Python
# -*- coding = utf-8 -*-
|
|
# @Time : 2025/2/13 下午5:01
|
|
# @File : schema.py
|
|
# @Software : PyCharm
|
|
# @Author : xingc
|
|
# @Desc :
|
|
import enum
|
|
from typing import Optional, Generic, TypeVar
|
|
|
|
from pydantic import BaseModel
|
|
|
|
T = TypeVar('T')
|
|
|
|
|
|
class BaseResponse(BaseModel, Generic[T]):
|
|
code: int = 200
|
|
message: str = 'success'
|
|
data: Optional[T] = None
|
|
|
|
|
|
class Paginated(BaseModel, Generic[T]):
|
|
list: Optional[T] = None
|
|
total: int
|
|
page: int
|
|
page_size: int
|
|
|
|
|
|
class SupportPlatformType(enum.Enum):
|
|
PSA = 'psa'
|
|
BGS = 'bgs'
|
|
CGC = 'cgc'
|
|
GBTC = 'gbtc'
|
|
CCG = 'ccg'
|
|
BCTC = 'bctc'
|
|
|
|
|
|
class PlatformSourceType(enum.Enum):
|
|
PSA = 'psa'
|
|
BGS = 'bgs'
|
|
CGC = 'cgc'
|
|
GBTC = 'gbtc'
|
|
CCG = 'ccg'
|
|
BCTC = 'bctc'
|
|
OTHER = 'other'
|
|
|
|
|
|
class MessageType(enum.Enum):
|
|
TEXT = 'text'
|
|
IMAGE = 'image'
|
|
|
|
|
|
class CardCategoryType(enum.Enum):
|
|
SPORTS = 'sports'
|
|
ANIME = 'anime'
|
|
OTHER = 'other'
|