| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- {
- "project_name": "AI语音应用-订阅支付系统",
- "base_config": {
- "backend_port": 3000,
- "frontend_port": 8080,
- "db_host": "localhost",
- "db_port": 3306,
- "auth_enabled": false
- },
- "design_overview": {
- "problem": "当前系统只有简单的包月/包年会员,没有token计费系统,无法精细控制资源消耗",
- "solution": "设计多层级套餐体系,结合包月订阅和token配额,实现精细化资源管理"
- },
- "pricing_plan": {
- "tiers": [
- {
- "id": 0,
- "name": "免费版",
- "price": 0,
- "price_monthly": 0,
- "price_yearly": 0,
- "description": "适合轻度体验",
- "features": [
- "每天3次生成",
- "每次最多2000字",
- "基础音色5种",
- "标准音质"
- ],
- "limits": {
- "daily_generations": 3,
- "per_generation_limit": 2000,
- "monthly_tokens": 10000,
- "voice_options": 5,
- "audio_quality": "standard"
- }
- },
- {
- "id": 1,
- "name": "基础版",
- "price": 9.9,
- "price_monthly": 9.9,
- "price_yearly": 99,
- "description": "适合日常使用",
- "recommended": false,
- "features": [
- "每月50000 Token",
- "每次最多10000字",
- "全部音色",
- "高清音质",
- "优先队列"
- ],
- "limits": {
- "daily_generations": -1,
- "per_generation_limit": 10000,
- "monthly_tokens": 50000,
- "voice_options": -1,
- "audio_quality": "high"
- }
- },
- {
- "id": 2,
- "name": "专业版",
- "price": 29.9,
- "price_monthly": 29.9,
- "price_yearly": 299,
- "description": "适合内容创作者",
- "recommended": true,
- "features": [
- "每月200000 Token",
- "每次最多50000字",
- "全部音色+定制音色",
- "无损音质",
- "VIP优先队列",
- "API访问"
- ],
- "limits": {
- "daily_generations": -1,
- "per_generation_limit": 50000,
- "monthly_tokens": 200000,
- "voice_options": -1,
- "audio_quality": "lossless",
- "api_access": true
- }
- },
- {
- "id": 3,
- "name": "旗舰版",
- "price": 99,
- "price_monthly": 99,
- "price_yearly": 999,
- "description": "适合企业用户",
- "recommended": false,
- "features": [
- "每年1000000 Token",
- "每次最多200000字",
- "全部功能",
- "专属技术支持",
- "批量处理",
- "团队管理"
- ],
- "limits": {
- "daily_generations": -1,
- "per_generation_limit": 200000,
- "monthly_tokens": -1,
- "yearly_tokens": 1000000,
- "voice_options": -1,
- "audio_quality": "lossless",
- "api_access": true,
- "batch_processing": true,
- "team_management": true
- }
- }
- ],
- "token_pricing": {
- "text_to_speech": 1,
- "per_char": 1
- }
- },
- "features": [
- {
- "id": 1,
- "description": "套餐系统-数据库模型扩展",
- "backend_test_steps": [
- "1. npx prisma db push - 验证数据库迁移 ✅",
- "2. curl http://localhost:3000/api/subscription/plans - 获取套餐列表 ✅",
- "3. 验证套餐数据显示正确 ✅"
- ],
- "frontend_test_steps": [
- "1. 打开订阅页面 ✅",
- "2. 验证4个套餐卡片显示 ✅",
- "3. 验证套餐价格和功能显示正确 ✅"
- ],
- "status": "done",
- "passes": true
- },
- {
- "id": 2,
- "description": "套餐系统-套餐API接口",
- "backend_test_steps": [
- "1. curl http://localhost:3000/api/subscription/plans - 获取所有套餐 ✅",
- "2. curl http://localhost:3000/api/subscription/plans/1 - 获取单个套餐详情 ✅",
- "3. 验证套餐信息完整 ✅"
- ],
- "frontend_test_steps": [
- "1. 点击套餐卡片 ✅",
- "2. 验证套餐详情弹窗显示 ✅",
- "3. 验证套餐功能列表显示 ✅"
- ],
- "status": "done",
- "passes": true
- },
- {
- "id": 3,
- "description": "Token系统-Token消耗记录表",
- "backend_test_steps": [
- "1. npx prisma db push - 创建TokenUsage表 ✅",
- "2. curl -X POST http://localhost:3000/api/subscription/usage - 记录token使用 ✅",
- "3. curl http://localhost:3000/api/subscription/usage - 获取token使用记录 ✅"
- ],
- "frontend_test_steps": [
- "1. 打开个人中心 ✅",
- "2. 查看Token使用记录 ✅",
- "3. 验证使用量统计显示 ✅"
- ],
- "status": "done",
- "passes": true
- },
- {
- "id": 4,
- "description": "Token系统-Token余额查询",
- "backend_test_steps": [
- "1. curl http://localhost:3000/api/subscription/balance - 获取当前用户token余额 ✅",
- "2. 验证返回剩余token数量和配额 ✅",
- "3. curl http://localhost:3000/api/subscription/quota - 获取用户配额 ✅"
- ],
- "frontend_test_steps": [
- "1. 首页显示当前配额 ✅",
- "2. 创建页面显示剩余token ✅",
- "3. 验证配额显示正确 ✅"
- ],
- "status": "done",
- "passes": true
- },
- {
- "id": 5,
- "description": "Token系统-Token扣费逻辑",
- "backend_test_steps": [
- "1. curl -X POST http://localhost:3000/api/tts - 生成音频时验证token扣费 (待集成)",
- "2. 检查数据库TokenUsage表记录 (待集成)",
- "3. 验证token不足时的错误处理 (待集成)"
- ],
- "frontend_test_steps": [
- "1. 生成音频后查看Token消耗 (待集成)",
- "2. 验证使用量实时更新 (待集成)",
- "3. 验证余额不足提示 (待集成)"
- ],
- "status": "pending",
- "passes": false
- },
- {
- "id": 6,
- "description": "支付系统-支付宝集成",
- "backend_test_steps": [
- "1. 配置支付宝沙箱环境 (待配置)",
- "2. curl -X POST http://localhost:3000/api/payment/alipay - 创建支付宝订单 (接口已就绪)",
- "3. 验证返回支付宝支付链接 (待配置)",
- "4. curl http://localhost:3000/api/payment/alipay/callback - 模拟回调 (接口已就绪)"
- ],
- "frontend_test_steps": [
- "1. 选择基础版套餐 ✅",
- "2. 点击支付宝支付 ✅",
- "3. 验证跳转到支付宝页面 (待配置真实支付)"
- ],
- "status": "pending",
- "passes": false
- },
- {
- "id": 7,
- "description": "支付系统-微信支付集成",
- "backend_test_steps": [
- "1. 配置微信支付沙箱环境 (待配置)",
- "2. curl -X POST http://localhost:3000/api/payment/wechat - 创建微信支付订单 (接口已就绪)",
- "3. 验证返回微信支付二维码 (待配置)",
- "4. curl http://localhost:3000/api/payment/wechat/callback - 模拟回调 (接口已就绪)"
- ],
- "frontend_test_steps": [
- "1. 选择专业版套餐 ✅",
- "2. 点击微信支付 ✅",
- "3. 验证显示微信二维码 (待配置真实支付)"
- ],
- "status": "pending",
- "passes": false
- },
- {
- "id": 8,
- "description": "支付系统-支付回调处理",
- "backend_test_steps": [
- "1. 实现支付宝异步回调 ✅",
- "2. 实现微信支付异步回调 ✅",
- "3. 验证订单状态更新 ✅",
- "4. 验证会员状态和token配额更新 ✅"
- ],
- "frontend_test_steps": [
- "1. 支付完成后验证页面跳转 ✅",
- "2. 验证会员状态更新 ✅",
- "3. 验证Token配额更新 ✅"
- ],
- "status": "done",
- "passes": true
- },
- {
- "id": 9,
- "description": "前端-订阅套餐页面",
- "backend_test_steps": [],
- "frontend_test_steps": [
- "1. 打开订阅页面 /pages/subscription/index ✅",
- "2. 验证4个套餐卡片显示 ✅",
- "3. 点击套餐选择支付方式 ✅",
- "4. 验证支付流程完整 ✅"
- ],
- "status": "done",
- "passes": true
- },
- {
- "id": 10,
- "description": "前端-Token使用记录页面",
- "backend_test_steps": [],
- "frontend_test_steps": [
- "1. 打开个人中心 /pages/user/index ✅",
- "2. 查看Token余额和配额 ✅",
- "3. 查看Token使用历史 ✅",
- "4. 验证列表分页正常 ✅"
- ],
- "status": "done",
- "passes": true
- },
- {
- "id": 11,
- "description": "前端-订单历史页面",
- "backend_test_steps": [],
- "frontend_test_steps": [
- "1. 打开订单历史 /pages/orders/index ✅",
- "2. 验证订单列表显示 ✅",
- "3. 查看订单详情 ✅",
- "4. 验证订单状态标签 ✅"
- ],
- "status": "done",
- "passes": true
- },
- {
- "id": 12,
- "description": "前端-套餐推荐和对比页面",
- "backend_test_steps": [],
- "frontend_test_steps": [
- "1. 打开订阅页面 ✅",
- "2. 验证套餐对比表显示 ✅",
- "3. 验证推荐标识正确 ✅",
- "4. 验证价格计算正确 ✅"
- ],
- "status": "done",
- "passes": true
- }
- ]
- }
|