27303e34eb
Implement 5 subscription endpoints matching frontend subscription.ts: API Endpoints: - GET /api/v1/subscription/current — get current subscription info - GET /api/v1/subscription/billing-records — get billing history - POST /api/v1/subscription/change-plan — upgrade/downgrade plan - POST /api/v1/subscription/cancel — cancel subscription - POST /api/v1/subscription/toggle-auto-renew — toggle auto-renewal Implementation Details: - Created subscription schemas (SubscriptionInfo, BillingRecord, etc.) - Created subscription routes with proper authentication - Integrated with quota_registry for plan limits - Added plan validation (free/standard/pro/enterprise) - Added billing cycle validation (monthly/yearly) - Registered subscription router in api_router Note: Billing records currently returns empty list (TODO: implement billing system) Auto-renew toggle is simulated (TODO: add auto_renew field to User model) All endpoints follow existing patterns from titles/voices/duplication APIs.
xiaoxia-saas API
结构
app/core/:配置与基础能力app/api/:路由组织app/schemas/:请求响应模型app/dependencies.py:依赖注入入口main.py:FastAPI 启动入口
当前可用接口
GET /api/healthGET /api/projects?workspace_id=...POST /api/projects