add 站点、订阅API
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException, BackgroundTasks
|
||||
from fastapi import APIRouter, Depends, BackgroundTasks
|
||||
|
||||
from app import schemas
|
||||
from app.chain.douban_sync import DoubanSyncChain
|
||||
@ -18,14 +18,9 @@ def start_douban_chain():
|
||||
@router.get("/sync", response_model=schemas.Response)
|
||||
async def sync_douban(
|
||||
background_tasks: BackgroundTasks,
|
||||
current_user: User = Depends(get_current_active_superuser)):
|
||||
_: User = Depends(get_current_active_superuser)):
|
||||
"""
|
||||
查询所有订阅
|
||||
"""
|
||||
if not current_user:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail="需要授权",
|
||||
)
|
||||
background_tasks.add_task(start_douban_chain)
|
||||
return {"success": True}
|
||||
|
Reference in New Issue
Block a user