@@ -60,6 +60,58 @@ class StatusResponse(BaseModel):
6060 licenses : list [dict ] = []
6161
6262
63+ class Plan (BaseModel ):
64+ id : str
65+ name : str
66+ price : float
67+ period : str # "month" | "year" | "lifetime"
68+ duration_days : int
69+ daily_quota : int
70+ featured : bool = False
71+ badge : str | None = None
72+ models : list [str ] = []
73+ multimodal : bool = False
74+ early_access : int = 0
75+ sync_devices : int = 1
76+ savings : str | None = None
77+
78+
79+ class PlanListResponse (BaseModel ):
80+ plans : list [Plan ]
81+
82+
83+ # ============================================================
84+ # 套餐目录(PlanCompareModal 数据源)
85+ # ============================================================
86+ # @ai-context: 公开套餐目录,供前端 PlanCompareModal 拉取并渲染价格/周期/
87+ # 配额对比;无需登录(auth.PUBLIC_PATHS 白名单)。
88+
89+ PLANS : list [Plan ] = [
90+ Plan (
91+ id = "pro_monthly" , name = "Pro 月卡" , price = 12.0 , period = "month" ,
92+ duration_days = 30 , daily_quota = 80 , featured = False ,
93+ models = ["基础模型" , "DeepSeek" ], multimodal = False , early_access = 0 , sync_devices = 2 ,
94+ ),
95+ Plan (
96+ id = "pro_yearly" , name = "Pro 年卡" , price = 99.0 , period = "year" ,
97+ duration_days = 365 , daily_quota = 80 , featured = True , badge = "最受欢迎" ,
98+ models = ["基础模型" , "DeepSeek" ], multimodal = False , early_access = 0 , sync_devices = 2 ,
99+ savings = "省 ¥45" ,
100+ ),
101+ Plan (
102+ id = "lifetime" , name = "终身 Pro" , price = 199.0 , period = "lifetime" ,
103+ duration_days = 36500 , daily_quota = 120 , featured = False , badge = "终身早鸟价" ,
104+ models = ["全部模型" ], multimodal = True , early_access = 5 , sync_devices = 3 ,
105+ ),
106+ ]
107+
108+
109+ @router .get ("/plans" , response_model = PlanListResponse )
110+ async def get_plans ():
111+ """返回当前可购买套餐列表(公开接口,无需登录)。"""
112+ return PlanListResponse (plans = PLANS )
113+
114+
63115# ============================================================
64116# 激活码验证逻辑
65117# ============================================================
0 commit comments