命令历史记录添加两种类型

This commit is contained in:
2024-06-16 09:02:29 +08:00
parent 2f900d0538
commit c58f124f0c
2 changed files with 3 additions and 3 deletions

View File

@@ -92,7 +92,7 @@ async def anti_duplicate_add(cls: type[T], model: T) -> None:
async def trigger(
session_persist_id: int,
game_platform: Literal['IO'],
command_type: CommandType | Literal['rank'],
command_type: CommandType | Literal['rank', 'config', 'record'],
command_args: list[str],
) -> AsyncGenerator:
yield
@@ -113,7 +113,7 @@ async def trigger(
async def trigger(
session_persist_id: int,
game_platform: GameType,
command_type: CommandType | Literal['rank'],
command_type: CommandType | Literal['rank', 'config', 'record'],
command_args: list[str],
) -> AsyncGenerator:
trigger_time = datetime.now(UTC)

View File

@@ -76,6 +76,6 @@ class TriggerHistoricalData(MappedAsDataclass, Model):
trigger_time: Mapped[datetime] = mapped_column(DateTime)
session_persist_id: Mapped[int]
game_platform: Mapped[GameType] = mapped_column(String(32), index=True)
command_type: Mapped[CommandType | Literal['rank']] = mapped_column(String(16), index=True)
command_type: Mapped[CommandType | Literal['rank', 'config', 'record']] = mapped_column(String(16), index=True)
command_args: Mapped[list[str]] = mapped_column(JSON)
finish_time: Mapped[datetime] = mapped_column(DateTime)