""" 配额检查路由。 """ from fastapi import APIRouter, Depends from app.core.dependencies import get_current_user from app.core.openapi import error_responses from app.features.quota.deps import get_quota_service from app.features.quota.schemas import QuotaCheckResponse from app.features.quota.service import QuotaService from app.features.user.models import User router = APIRouter( prefix="/api/quota", tags=["quota"], responses=error_responses(401, 403, 404, 429), ) @router.get("/check", response_model=QuotaCheckResponse) async def check_quota( current_user: User = Depends(get_current_user), service: QuotaService = Depends(get_quota_service), ): """检查用户配额使用情况""" return await service.check(current_user.id, current_user.subscription_type)