add 站点、订阅API

This commit is contained in:
jxxghp
2023-06-12 09:27:39 +08:00
parent 6e8b687545
commit e10776cf1d
5 changed files with 69 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
from fastapi import APIRouter, HTTPException, Depends
from fastapi import APIRouter, Depends
from app import schemas
from app.chain.identify import IdentifyChain
@@ -11,15 +11,10 @@ router = APIRouter()
@router.post("/recognize", response_model=schemas.Context)
async def recognize(title: str,
subtitle: str = None,
current_user: User = Depends(get_current_active_user)):
_: User = Depends(get_current_active_user)):
"""
识别媒体信息
"""
if not current_user:
raise HTTPException(
status_code=400,
detail="需要授权",
)
# 识别媒体信息
context = IdentifyChain().process(title=title, subtitle=subtitle)
return context.to_dict()