新增应用可授权数量
This commit is contained in:
@@ -62,6 +62,7 @@ async def create_user_oauth_app(
|
||||
secret: str,
|
||||
open_type: int,
|
||||
create_by: str | None = None,
|
||||
count: int = 100,
|
||||
) -> UserOAuthApp:
|
||||
existing = await get_user_oauth_app_by_app_id(db, app_id)
|
||||
if existing:
|
||||
@@ -72,6 +73,7 @@ async def create_user_oauth_app(
|
||||
app_id=app_id,
|
||||
secret=secret,
|
||||
open_type=open_type,
|
||||
count=count,
|
||||
create_by=create_by,
|
||||
)
|
||||
db.add(app)
|
||||
@@ -87,6 +89,7 @@ async def update_user_oauth_app(
|
||||
secret: str | None = None,
|
||||
open_type: int | None = None,
|
||||
status: int | None = None,
|
||||
count: int | None = None,
|
||||
create_by: str | None = None,
|
||||
) -> UserOAuthApp | None:
|
||||
app = await get_user_oauth_app_by_id(db, id)
|
||||
@@ -99,6 +102,8 @@ async def update_user_oauth_app(
|
||||
app.open_type = open_type
|
||||
if status is not None:
|
||||
app.status = status
|
||||
if count is not None:
|
||||
app.count = count
|
||||
if create_by is not None:
|
||||
app.create_by = create_by
|
||||
|
||||
|
||||
Reference in New Issue
Block a user