mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-25 09:37:38 +00:00
38 lines
902 B
Python
38 lines
902 B
Python
import enum
|
|
|
|
from pydantic import BaseModel
|
|
from simnet.models.starrail.diary import StarRailDiary
|
|
from simnet.models.zzz.chronicle.challenge import ZZZChallenge
|
|
|
|
from gram_core.services.history_data.models import HistoryData
|
|
|
|
__all__ = (
|
|
"HistoryData",
|
|
"HistoryDataTypeEnum",
|
|
"HistoryDataAbyss",
|
|
"HistoryDataLedger",
|
|
)
|
|
|
|
|
|
class HistoryDataTypeEnum(int, enum.Enum):
|
|
ABYSS = 0 # 混沌回忆
|
|
CHALLENGE_STORY = 1 # 虚构叙事
|
|
LEDGER = 2 # 开拓月历
|
|
CHALLENGE_BOSS = 3 # 末日幻影
|
|
|
|
|
|
class HistoryDataAbyss(BaseModel):
|
|
abyss_data: ZZZChallenge
|
|
|
|
@classmethod
|
|
def from_data(cls, data: HistoryData) -> "HistoryDataAbyss":
|
|
return cls.parse_obj(data.data)
|
|
|
|
|
|
class HistoryDataLedger(BaseModel):
|
|
diary_data: StarRailDiary
|
|
|
|
@classmethod
|
|
def from_data(cls, data: HistoryData) -> "HistoryDataLedger":
|
|
return cls.parse_obj(data.data)
|