mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-25 09:37:38 +00:00
18 lines
393 B
Python
18 lines
393 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, validator
|
|
|
|
__all__ = ("GachaInfo",)
|
|
|
|
|
|
class GachaInfo(BaseModel):
|
|
begin_time: datetime
|
|
end_time: datetime
|
|
gacha_id: str
|
|
gacha_name: str
|
|
gacha_type: int
|
|
|
|
@validator("begin_time", "end_time", pre=True, allow_reuse=True)
|
|
def validate_time(cls, v):
|
|
return datetime.strptime(v, "%Y-%m-%d %H:%M:%S")
|