PamGram/modules/apihelper/models/genshin/gacha.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
409 B
Python
Raw Normal View History

2022-12-10 12:37:43 +00:00
from datetime import datetime
2024-11-30 14:31:42 +00:00
from pydantic import field_validator, BaseModel
2022-12-10 12:37:43 +00:00
__all__ = ("GachaInfo",)
class GachaInfo(BaseModel):
begin_time: datetime
end_time: datetime
gacha_id: str
gacha_name: str
gacha_type: int
2024-11-30 14:31:42 +00:00
@field_validator("begin_time", "end_time", mode="before")
@classmethod
2022-12-10 12:37:43 +00:00
def validate_time(cls, v):
return datetime.strptime(v, "%Y-%m-%d %H:%M:%S")