mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-12 06:55:49 +08:00
🐛 补充缺失方法
This commit is contained in:
parent
9e5277c558
commit
363c8f7082
@ -55,10 +55,8 @@ class BaseIDModel(SQLModel):
|
||||
|
||||
@classmethod
|
||||
@with_session
|
||||
async def full_insert_data(
|
||||
cls, session: AsyncSession, model: Type["BaseIDModel"], **data
|
||||
) -> int:
|
||||
session.add(model(**data))
|
||||
async def full_insert_data(cls, session: AsyncSession, **data) -> int:
|
||||
session.add(cls(**data))
|
||||
await session.commit()
|
||||
return 0
|
||||
|
||||
|
@ -351,7 +351,6 @@ class SQLA:
|
||||
#####################
|
||||
async def insert_push_data(self, uid: str):
|
||||
await GsPush.full_insert_data(
|
||||
GsPush,
|
||||
bot_id=self.bot_id,
|
||||
uid=uid,
|
||||
coin_push='off',
|
||||
@ -403,4 +402,7 @@ class SQLA:
|
||||
await session.close()
|
||||
|
||||
async def insert_new_bind(self, **kwargs):
|
||||
await GsBind.full_insert_data(GsBind, **kwargs)
|
||||
await GsBind.full_insert_data(**kwargs)
|
||||
|
||||
async def insert_new_user(self, **kwargs):
|
||||
await GsUser.full_insert_data(**kwargs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user