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
|
@classmethod
|
||||||
@with_session
|
@with_session
|
||||||
async def full_insert_data(
|
async def full_insert_data(cls, session: AsyncSession, **data) -> int:
|
||||||
cls, session: AsyncSession, model: Type["BaseIDModel"], **data
|
session.add(cls(**data))
|
||||||
) -> int:
|
|
||||||
session.add(model(**data))
|
|
||||||
await session.commit()
|
await session.commit()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -351,7 +351,6 @@ class SQLA:
|
|||||||
#####################
|
#####################
|
||||||
async def insert_push_data(self, uid: str):
|
async def insert_push_data(self, uid: str):
|
||||||
await GsPush.full_insert_data(
|
await GsPush.full_insert_data(
|
||||||
GsPush,
|
|
||||||
bot_id=self.bot_id,
|
bot_id=self.bot_id,
|
||||||
uid=uid,
|
uid=uid,
|
||||||
coin_push='off',
|
coin_push='off',
|
||||||
@ -403,4 +402,7 @@ class SQLA:
|
|||||||
await session.close()
|
await session.close()
|
||||||
|
|
||||||
async def insert_new_bind(self, **kwargs):
|
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