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:
@@ -1,5 +1,3 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
@@ -9,17 +7,24 @@ class PlanResponse(BaseModel):
|
||||
display_name: str
|
||||
price: float
|
||||
currency: str
|
||||
features: List[str]
|
||||
max_conversations: Optional[int] = None
|
||||
max_chapters: Optional[int] = None
|
||||
max_words: Optional[int] = None
|
||||
features: list[str]
|
||||
max_conversations: int | None = None
|
||||
max_chapters: int | None = None
|
||||
max_words: int | None = None
|
||||
is_popular: bool = False
|
||||
|
||||
|
||||
class PlanUsageResponse(BaseModel):
|
||||
conversations: int
|
||||
chapters: int
|
||||
max_conversations: int | None = None
|
||||
max_chapters: int | None = None
|
||||
|
||||
|
||||
class CurrentPlanResponse(BaseModel):
|
||||
plan_id: str
|
||||
plan_name: str
|
||||
subscription_type: str
|
||||
expires_at: Optional[str] = None
|
||||
features: List[str]
|
||||
usage: dict
|
||||
expires_at: str | None = None
|
||||
features: list[str]
|
||||
usage: PlanUsageResponse
|
||||
|
||||
Reference in New Issue
Block a user