first init
This commit is contained in:
55
core/base/schema.py
Normal file
55
core/base/schema.py
Normal file
@@ -0,0 +1,55 @@
|
||||
# -*- 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'
|
||||
Reference in New Issue
Block a user