refactor(api): TOML 配置 SSOT、统一错误契约、Auth/事务加固与可观测性 (#33)

配置 SSOT(TOML + .env)
统一错误契约
Auth 与事务边界
Redis / Celery 可靠性:业务 Redis(DB/0)与 Celery broker/backend(DB/1)显式拆分;连接池、sync client
可观测性(OpenTelemetry + LGTM)
This commit is contained in:
Sully
2026-05-22 13:44:50 +08:00
committed by GitHub
parent f09ae248f9
commit 53e0065e3e
298 changed files with 15247 additions and 4344 deletions

View File

@@ -1,13 +1,22 @@
"""Plan feature dependencies: get_plan_service."""
from typing import Annotated
from fastapi import Depends
from app.core.dependencies import get_current_user
from app.features.plan.service import PlanService
from app.features.quota.deps import get_quota_service
from app.features.quota.service import QuotaService
from app.features.user.models import User
from app.core.deps_types import DbDep
def get_plan_service(
quota_service: QuotaService = Depends(get_quota_service),
quota_service: Annotated[QuotaService, Depends(get_quota_service)],
) -> PlanService:
return PlanService(quota_service=quota_service)
PlanServiceDep = Annotated[PlanService, Depends(get_plan_service)]
CurrentUserDep = Annotated[User, Depends(get_current_user)]