MCPcopy Create free account
hub / github.com/Loping151/RoverSign / select_waves_user

Method select_waves_user

RoverSign/utils/database/models.py:97–118  ·  view source on GitHub ↗

根据user_id、uid、bot_id查询数据

(
        cls: Type[T_WavesUser],
        session: AsyncSession,
        uid: str,
        user_id: str,
        bot_id: str,
        game_id: Optional[int] = None,
    )

Source from the content-addressed store, hash-verified

95 @classmethod
96 @with_session
97 async def select_waves_user(
98 cls: Type[T_WavesUser],
99 session: AsyncSession,
100 uid: str,
101 user_id: str,
102 bot_id: str,
103 game_id: Optional[int] = None,
104 ) -> Optional[T_WavesUser]:
105 """
106 根据user_id、uid、bot_id查询数据
107 """
108 filters = [
109 cls.user_id == user_id,
110 cls.uid == uid,
111 cls.bot_id == bot_id,
112 ]
113 if game_id is not None:
114 filters.append(cls.game_id == game_id)
115 sql = select(cls).where(*filters)
116 result = await session.execute(sql)
117 data = result.scalars().all()
118 return data[0] if data else None
119
120 @classmethod
121 @with_session

Callers 4

get_hide_uid_prefFunction · 0.80
get_self_waves_ckMethod · 0.80
set_pgr_config_funcFunction · 0.80
open_switch_funcFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected