fix: 生产安全检查 — 鉴权 + 资金安全 + Slot TTL
1. upload.py: /video /audio 端点添加 get_current_user 鉴权 2. caption.py: /ata/align 端点添加 get_current_user 鉴权 3. points.py: allow_negative 硬编码 False,禁止客户端控制欠费 4. slot_manager.py: TTL 1800s → 1200s,减少异常崩溃后的槽位泄漏时间 5. points.py: 顺手修复 ruff UP017(timezone.utc → UTC)
This commit is contained in:
@@ -7,9 +7,11 @@
|
||||
|
||||
import logging
|
||||
|
||||
from fastapi import APIRouter, HTTPException, Request
|
||||
from fastapi import APIRouter, Depends, HTTPException, Request
|
||||
|
||||
from app.api.deps import get_current_user
|
||||
from app.core.exceptions import PlatformError
|
||||
from app.models.user import User
|
||||
from app.schemas.caption import (
|
||||
AutoAlignSubmitRequest,
|
||||
)
|
||||
@@ -36,7 +38,12 @@ router = APIRouter(prefix="/caption", tags=["Caption"])
|
||||
|
||||
|
||||
@router.post("/ata/align")
|
||||
async def auto_align_caption(request_body: AutoAlignSubmitRequest, request: Request, max_wait_time: int = 120):
|
||||
async def auto_align_caption(
|
||||
request_body: AutoAlignSubmitRequest,
|
||||
request: Request,
|
||||
max_wait_time: int = 120,
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
"""
|
||||
自动字幕打轴(完整流程)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user