mirror of
https://gitea.tendokyu.moe/Dniel97/artemis.git
synced 2026-10-10 10:48:11 +03:00
idac: fix vs info battle enum
This commit is contained in:
@@ -30,10 +30,10 @@ class IDACVsInfoDb(BaseData):
|
||||
return self.mapper.vs_infos_to_dto(vs_infos_db)
|
||||
|
||||
async def get_vs_info_by_mode(
|
||||
self, aime_id: int, battle_mode: int
|
||||
self, aime_id: int, battle_mode: VSInfoBattleModeEnum
|
||||
) -> Optional[VsInfoDto]:
|
||||
sql = select(VsInfoDb).where(
|
||||
and_(VsInfoDb.user == aime_id, VsInfoDb.battle_mode == battle_mode)
|
||||
and_(VsInfoDb.user == aime_id, VsInfoDb.battle_mode == battle_mode.value)
|
||||
)
|
||||
result = await self.execute(sql)
|
||||
vs_info_db = result.scalars().first()
|
||||
@@ -43,12 +43,12 @@ class IDACVsInfoDb(BaseData):
|
||||
return self.mapper.vs_info_to_dto(vs_info_db)
|
||||
|
||||
async def get_vs_course_infos_by_mode(
|
||||
self, aime_id: int, battle_mode: int
|
||||
self, aime_id: int, battle_mode: VSInfoBattleModeEnum
|
||||
) -> Optional[list[VsCourseInfoDto]]:
|
||||
sql = select(VsCourseInfoDb).where(
|
||||
and_(
|
||||
VsCourseInfoDb.user == aime_id,
|
||||
VsCourseInfoDb.battle_mode == battle_mode,
|
||||
VsCourseInfoDb.battle_mode == battle_mode.value,
|
||||
)
|
||||
)
|
||||
result = await self.execute(sql)
|
||||
@@ -75,7 +75,10 @@ class IDACVsInfoDb(BaseData):
|
||||
return result.lastrowid
|
||||
|
||||
async def put_vs_course_info(
|
||||
self, aime_id: int, battle_mode: VSInfoBattleModeEnum, course_info_data: VsCourseInfoDto
|
||||
self,
|
||||
aime_id: int,
|
||||
battle_mode: VSInfoBattleModeEnum,
|
||||
course_info_data: VsCourseInfoDto,
|
||||
) -> Optional[int]:
|
||||
course_info_data_db = course_info_data.model_dump_db()
|
||||
course_info_data_db["user"] = aime_id
|
||||
|
||||
Reference in New Issue
Block a user