fix(#1895): /subscription/plans 路由挂载位置修复(解决 404) #1955
Reference in New Issue
Block a user
Delete Branch "fix/1895-subscription-plans-route"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
PR #1951 把 GET /subscription/plans 挂在了 points_router(prefix=/points)上,导致实际路径是 /points/subscription/plans 而非前端期望的 /subscription/plans,返回 404。
修复
验证
The /subscription/plans endpoint was incorrectly mounted on points_router (which has prefix=/points), making it accessible at /points/subscription/plans instead of /subscription/plans. Moved it to the subscription_router (prefix=/subscription) where it belongs, next to /current /change-plan /cancel /toggle-auto-renew etc. Also cleaned up: - Removed misplaced endpoint and unused imports (MembershipPlanItem/MembershipPlansResponse, MEMBERSHIP_PRICES) from points.py - Fixed unit tests to load the real subscription module (avoiding sys.modules shadowing by the integration test fixture) - Added proper typing import to subscription.py Endpoint: GET /subscription/plans → returns {plans: [...]} with monthly/quarterly/yearly tiers, price_cents, monthly_price_cents, duration_days, points_discount, features.🚀 预览环境已部署
🗑️ 预览环境已清理
PR #1955 已关闭或合并,对应的预览环境已被清理。