perf(douyu): 拆分任务槽并改造绑定扫码调度

This commit is contained in:
yml
2026-11-20 22:03:20 +08:00
parent 8869e427d2
commit 071d45ad1d
40 changed files with 1635 additions and 245 deletions
@@ -9,6 +9,7 @@ from hmac import compare_digest
from typing import Any
from fastapi import APIRouter, Depends, Header, HTTPException, Request
from fastapi.responses import JSONResponse
from sqlalchemy.orm import Session
from starlette.requests import ClientDisconnect
@@ -132,12 +133,16 @@ async def start_customer_binding(
task_id: int,
req: PlatformFulfillmentCustomerBindingAction,
db: Session = Depends(get_db),
) -> dict[str, Any]:
return await service.customer_start_binding(
) -> JSONResponse:
payload = await service.customer_start_binding(
db,
task_id=task_id,
force_refresh=req.force_refresh,
)
return JSONResponse(
status_code=202 if payload.get("accepted") else 200,
content=payload,
)
@router.get(