diff --git a/nonebot_plugin_tetris_stats/games/tetrio/api/models.py b/nonebot_plugin_tetris_stats/games/tetrio/api/models.py index 22b0658..b85f0d5 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/api/models.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/api/models.py @@ -15,8 +15,3 @@ class TETRIOHistoricalData(MappedAsDataclass, Model): api_type: Mapped[Literal['User Info', 'User Records']] = mapped_column(String(16), index=True) data: Mapped[SuccessModel] = mapped_column(PydanticType(get_model=[SuccessModel.__subclasses__], models=set())) update_time: Mapped[datetime] = mapped_column(DateTime, index=True) - - -class TETRIOUserConfig(MappedAsDataclass, Model): - id: Mapped[int] = mapped_column(init=False, primary_key=True) - query_template: Mapped[Literal['v1', 'v2']] = mapped_column(String(2)) diff --git a/nonebot_plugin_tetris_stats/games/tetrio/model.py b/nonebot_plugin_tetris_stats/games/tetrio/models.py similarity index 84% rename from nonebot_plugin_tetris_stats/games/tetrio/model.py rename to nonebot_plugin_tetris_stats/games/tetrio/models.py index db45116..c2f927b 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/model.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/models.py @@ -5,6 +5,7 @@ from sqlalchemy import JSON, DateTime, String from sqlalchemy.orm import Mapped, MappedAsDataclass, mapped_column from .api.typing import Rank +from .typing import Template class IORank(MappedAsDataclass, Model): @@ -26,3 +27,8 @@ class IORank(MappedAsDataclass, Model): index=True, ) file_hash: Mapped[str | None] = mapped_column(String(128), index=True) + + +class TETRIOUserConfig(MappedAsDataclass, Model): + id: Mapped[int] = mapped_column(primary_key=True) + query_template: Mapped[Template] = mapped_column(String(2)) diff --git a/nonebot_plugin_tetris_stats/games/tetrio/query.py b/nonebot_plugin_tetris_stats/games/tetrio/query.py index 63de28a..6f80499 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/query.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/query.py @@ -46,7 +46,7 @@ from .api.schemas.tetra_league import TetraLeagueSuccess from .api.schemas.user_info import NeverPlayedLeague, NeverRatedLeague, RatedLeague from .api.schemas.user_records import SoloModeRecord, UserRecordsSuccess from .constant import GAME_TYPE, TR_MAX, TR_MIN -from .model import IORank +from .models import IORank from .typing import Template UTC = timezone.utc diff --git a/nonebot_plugin_tetris_stats/games/tetrio/rank.py b/nonebot_plugin_tetris_stats/games/tetrio/rank.py index c103e41..7c0b047 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/rank.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/rank.py @@ -30,7 +30,7 @@ from .api.schemas.user import User from .api.tetra_league import full_export from .api.typing import Rank from .constant import GAME_TYPE, RANK_PERCENTILE -from .model import IORank +from .models import IORank UTC = timezone.utc