diff --git a/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/leaderboards/solo.py b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/leaderboards/solo.py new file mode 100644 index 0000000..dbcf7e6 --- /dev/null +++ b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/leaderboards/solo.py @@ -0,0 +1,12 @@ +from pydantic import BaseModel + +from ..base import SuccessModel +from ..summaries.solo import Record + + +class Data(BaseModel): + entries: list[Record] + + +class SoloSuccessModel(SuccessModel): + data: Data diff --git a/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/leaderboards/xp.py b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/leaderboards/xp.py new file mode 100644 index 0000000..65415b5 --- /dev/null +++ b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/leaderboards/xp.py @@ -0,0 +1,39 @@ +from datetime import datetime + +from pydantic import BaseModel, Field + +from ...typing import Rank +from ..base import SuccessModel +from ..summaries.base import P + + +class League(BaseModel): + gamesplayed: int + gameswon: int + rating: int + rank: Rank + decaying: bool + + +class Entry(BaseModel): + id: str = Field(..., alias='_id') + username: str + role: str + xp: float + league: League + supporter: bool | None = None + verified: bool + country: str | None = None + ts: datetime + gamesplayed: int + gameswon: int + gametime: float + p: P + + +class Data(BaseModel): + entries: list[Entry] + + +class XpSuccessModel(SuccessModel): + data: Data diff --git a/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/leaderboards/zenith.py b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/leaderboards/zenith.py new file mode 100644 index 0000000..690f8c1 --- /dev/null +++ b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/leaderboards/zenith.py @@ -0,0 +1,12 @@ +from pydantic import BaseModel + +from ..base import SuccessModel +from ..summaries.zenith import Record + + +class Data(BaseModel): + entries: list[Record] + + +class ZenithSuccessModel(SuccessModel): + data: Data diff --git a/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/base.py b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/base.py index 171971a..9350d44 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/base.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/base.py @@ -4,9 +4,9 @@ from pydantic import BaseModel class User(BaseModel): id: str username: str - avatar_revision: int - banner_revision: int - country: str + avatar_revision: int | None + banner_revision: int | None + country: str | None verified: int supporter: int diff --git a/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/solo.py b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/solo.py index 8f72991..76ac773 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/solo.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/solo.py @@ -34,7 +34,7 @@ class Clears(BaseModel): class Garbage(BaseModel): sent: int received: int - attack: int + attack: int | None cleared: int diff --git a/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/zenith.py b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/zenith.py index e1eba92..9058c33 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/zenith.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/api/schemas/summaries/zenith.py @@ -76,7 +76,7 @@ class Stats(BaseModel): kills: int finesse: Finesse zenith: _Zenith - finaltime: int + finaltime: float class Results(BaseModel):