فهرست منبع

feat: 修正端口配置,更新feature_list_phase2.json

- 修正后端端口为3000
- 修正前端端口为5173(uniapp H5)
- 重新生成feature_list_phase2.json(20个功能)
- 修正init.sh中的端口错误
MyFramework User 5 ماه پیش
والد
کامیت
a2db10dc82
3فایلهای تغییر یافته به همراه197 افزوده شده و 181 حذف شده
  1. 192 178
      feature_list_phase2.json
  2. 4 3
      init.sh
  3. 1 0
      my-uniapp-vue3/vite.config.ts

+ 192 - 178
feature_list_phase2.json

@@ -1,310 +1,324 @@
 {
-  "project_name": "AI有声书生成工具-第二期",
+  "project_name": "AI有声书生成工具 - 第二期",
   "base_config": {
     "backend_port": 3000,
     "frontend_port": 5173,
     "db_host": "localhost",
-    "db_port": 3306
+    "db_port": 3306,
+    "auth_enabled": false
   },
   "features": [
     {
       "id": 1,
-      "description": "播放记录功能 - 记录播放进度,支持续播",
-      "priority": "P1",
-      "phase": "第一阶段",
+      "description": "播放记录 - 数据库表设计",
       "backend_test_steps": [
-        "1. curl -X GET http://localhost:3000/api/player/progress - 验证获取播放进度接口返回 200",
-        "2. curl -X POST http://localhost:3000/api/player/progress -d '{\"audioId\":\"test\",\"progress\":30}' - 验证保存进度接口返回 200",
-        "3. curl -X GET http://localhost:3000/api/player/progress - 验证保存后能正确获取进度"
+        "1. curl -X POST http://localhost:3000/api/player/progress -H 'Content-Type: application/json' -d '{\"userId\":\"test-user\",\"audioId\":\"audio-001\",\"progress\":30.5,\"duration\":180}' - 验证创建播放记录",
+        "2. curl http://localhost:3000/api/player/progress?userId=test-user - 验证查询播放记录列表",
+        "3. curl -X PUT http://localhost:3000/api/player/progress/audio-001 -H 'Content-Type: application/json' -d '{\"progress\":60.0}' - 验证更新播放进度",
+        "4. curl -X DELETE http://localhost:3000/api/player/progress/audio-001 - 验证删除播放记录"
       ],
       "frontend_test_steps": [
-        "1. 打开首页,播放一个音频",
-        "2. 暂停播放,查看是否显示当前进度",
-        "3. 退出页面后重新进入",
-        "4. 验证是否显示'继续播放'按钮并正确续播到30秒位置"
+        "1. 打开播放器页面",
+        "2. 点击播放音频",
+        "3. 等待5秒后查看播放进度是否自动保存",
+        "4. 刷新页面验证续播位置是否正确"
       ],
-      "status": "done",
-      "passes": true
+      "status": "init",
+      "passes": false
     },
     {
       "id": 2,
-      "description": "收藏功能 - 收藏喜欢的音频",
-      "priority": "P1",
-      "phase": "第一阶段",
+      "description": "播放记录 - 前端播放器集成",
       "backend_test_steps": [
-        "1. curl -X GET http://localhost:3000/api/favorites - 验证获取收藏列表接口返回 200",
-        "2. curl -X POST http://localhost:3000/api/favorites -d '{\"audioId\":\"test-audio-1\"}' - 验证添加收藏接口返回 200",
-        "3. curl -X GET http://localhost:3000/api/favorites - 验证收藏列表包含新添加的音频",
-        "4. curl -X DELETE http://localhost:3000/api/favorites/test-audio-1 - 验证取消收藏接口返回 200"
+        "1. curl http://localhost:3000/api/player/progress?userId=test-user - 验证获取播放进度接口正常"
       ],
       "frontend_test_steps": [
-        "1. 打开播放器页面播放音频",
-        "2. 点击收藏按钮(心形图标)",
-        "3. 验证按钮变为实心红色",
-        "4. 进入收藏页面,验证已收藏的音频显示在列表中",
-        "5. 点击取消收藏,验证列表中该音频消失"
+        "1. 打开player页面",
+        "2. 选择一个有播放进度的音频",
+        "3. 验证是否从上次进度位置开始播放",
+        "4. 验证播放进度每5秒自动保存"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 3,
-      "description": "定时关闭功能 - 睡眠定时、15/30/60分钟自动停止",
-      "priority": "P1",
-      "phase": "第一阶段",
-      "backend_test_steps": [],
+      "description": "收藏功能 - 数据库表设计",
+      "backend_test_steps": [
+        "1. curl -X POST http://localhost:3000/api/favorites -H 'Content-Type: application/json' -d '{\"userId\":\"test-user\",\"audioId\":\"audio-002\"}' - 验证添加收藏",
+        "2. curl http://localhost:3000/api/favorites?userId=test-user - 验证查询收藏列表",
+        "3. curl -X DELETE http://localhost:3000/api/favorites/audio-002 - 验证取消收藏",
+        "4. curl -X POST http://localhost:3000/api/favorites -H 'Content-Type: application/json' -d '{\"userId\":\"test-user\",\"audioId\":\"audio-003\"}' - 重新添加收藏用于后续测试"
+      ],
       "frontend_test_steps": [
-        "1. 打开播放器页面开始播放",
-        "2. 点击定时按钮打开定时设置",
-        "3. 选择15分钟定时",
-        "4. 验证显示倒计时(如14:59)",
-        "5. 等待约1分钟后刷新页面",
-        "6. 验证倒计时正确递减",
-        "7. 等待定时结束,验证播放自动暂停"
+        "1. 打开player页面",
+        "2. 点击收藏按钮",
+        "3. 验证收藏状态变为已收藏",
+        "4. 进入favorites页面",
+        "5. 验证收藏的音频显示在列表中",
+        "6. 点击取消收藏按钮",
+        "7. 验证列表中该音频已移除"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 4,
-      "description": "播放速度记忆 - 0.5x-2x速听,记忆用户偏好",
-      "priority": "P1",
-      "phase": "第一阶段",
+      "description": "收藏功能 - favorites页面开发",
       "backend_test_steps": [
-        "1. curl -X GET http://localhost:3000/api/user/preferences - 验证获取用户偏好接口返回 200",
-        "2. curl -X PUT http://localhost:3000/api/user/preferences -d '{\"playSpeed\":1.5}' - 验证更新偏好接口返回 200",
-        "3. curl -X GET http://localhost:3000/api/user/preferences - 验证playSpeed为1.5"
+        "1. curl http://localhost:3000/api/favorites?userId=test-user - 验证收藏列表查询"
       ],
       "frontend_test_steps": [
-        "1. 打开播放器页面",
-        "2. 点击倍速按钮选择1.5x",
-        "3. 验证播放速度变为1.5x",
-        "4. 退出页面",
-        "5. 重新进入播放器页面",
-        "6. 验证倍速按钮显示1.5x且播放速度为1.5x"
+        "1. 进入favorites收藏页面",
+        "2. 验证页面正常加载,显示收藏列表",
+        "3. 点击某个音频进入播放器",
+        "4. 返回favorites页面验证列表刷新正常"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 5,
-      "description": "分享功能 - 分享给微信好友/朋友圈",
-      "priority": "P1",
-      "phase": "第一阶段",
-      "backend_test_steps": [
-        "1. curl -X POST http://localhost:3000/api/share -d '{\"audioId\":\"test-audio-1\"}' - 验证生成分享链接接口返回 200"
-      ],
+      "description": "定时关闭 - 前端定时器实现",
+      "backend_test_steps": [],
       "frontend_test_steps": [
-        "1. 打开播放器页面",
-        "2. 点击分享按钮",
-        "3. 验证弹出分享菜单(微信好友、朋友圈、复制链接)",
-        "4. 选择'复制链接',验证剪贴板包含分享URL",
-        "5. 点击微信好友,验证调用微信分享API"
+        "1. 打开player页面并开始播放",
+        "2. 点击定时关闭按钮",
+        "3. 选择15分钟定时",
+        "4. 验证倒计时显示正确",
+        "5. 等待或快进到定时时间",
+        "6. 验证播放自动暂停"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 6,
-      "description": "加载优化 - 骨架屏、缓存优化",
-      "priority": "P1",
-      "phase": "贯穿全程",
-      "backend_test_steps": [],
+      "description": "播放速度记忆 - 用户偏好API",
+      "backend_test_steps": [
+        "1. curl -X POST http://localhost:3000/api/user/preferences -H 'Content-Type: application/json' -d '{\"userId\":\"test-user\",\"playSpeed\":1.5}' - 验证创建用户偏好",
+        "2. curl http://localhost:3000/api/user/preferences?userId=test-user - 验证查询用户偏好",
+        "3. curl -X PUT http://localhost:3000/api/user/preferences -H 'Content-Type: application/json' -d '{\"userId\":\"test-user\",\"playSpeed\":2.0}' - 验证更新播放速度",
+        "4. curl -X PUT http://localhost:3000/api/user/preferences -H 'Content-Type: application/json' -d '{\"userId\":\"test-user\",\"playSpeed\":1.0}' - 恢复默认速度"
+      ],
       "frontend_test_steps": [
-        "1. 清除浏览器缓存",
-        "2. 打开首页",
-        "3. 验证显示骨架屏加载动画",
-        "4. 验证内容加载后骨架屏消失",
-        "5. 再次打开首页",
-        "6. 验证第二次加载更快(使用缓存)"
+        "1. 打开player页面",
+        "2. 调整播放速度为1.5x",
+        "3. 刷新页面",
+        "4. 验证播放速度仍为1.5x"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 7,
-      "description": "全局搜索 - 搜索有声书标题、历史记录",
-      "priority": "P1",
-      "phase": "第二阶段",
+      "description": "分享功能 - 微信JSSDK集成",
       "backend_test_steps": [
-        "1. curl -X GET 'http://localhost:3000/api/search?q=test' - 验证搜索接口返回 200",
-        "2. curl -X GET 'http://localhost:3000/api/search?q=' - 验证空关键词返回历史记录",
-        "3. curl -X GET 'http://localhost:3000/api/search?q=小说' - 验证中文搜索正常"
+        "1. curl http://localhost:3000/api/share?audioId=audio-001 - 验证生成分享链接接口"
       ],
       "frontend_test_steps": [
-        "1. 点击顶部搜索图标进入搜索页面",
-        "2. 验证显示搜索历史和热门推荐",
-        "3. 输入关键词'test'",
-        "4. 点击搜索按钮",
-        "5. 验证搜索结果列表显示匹配的内容",
-        "6. 点击搜索结果",
-        "7. 验证跳转到播放器页面"
+        "1. 打开player页面",
+        "2. 点击分享按钮",
+        "3. 验证分享面板正常弹出",
+        "4. 验证分享卡片显示标题、封面、简介"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 8,
-      "description": "内容分类 - 按类型筛选(故事/小说/新闻/学习)",
-      "priority": "P2",
-      "phase": "第二阶段",
+      "description": "分享功能 - 分享卡片生成",
       "backend_test_steps": [
-        "1. curl -X GET http://localhost:3000/api/categories - 验证获取分类列表接口返回 200",
-        "2. curl -X GET http://localhost:3000/api/categories/1 - 验证获取分类下音频接口返回 200"
+        "1. curl http://localhost:3000/api/share?audioId=audio-001 - 验证分享信息接口返回正确数据"
       ],
       "frontend_test_steps": [
-        "1. 在首页点击分类标签(如'小说')",
-        "2. 验证内容列表刷新为该分类的内容",
-        "3. 切换到其他分类(如'学习')",
-        "4. 验证内容列表正确切换",
-        "5. 点击'全部'标签",
-        "6. 验证显示全部内容"
+        "1. 打开player页面",
+        "2. 点击分享到微信好友",
+        "3. 验证分享内容包含音频标题",
+        "4. 点击分享到朋友圈",
+        "5. 验证朋友圈分享内容正确"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 9,
-      "description": "音质选择 - 高/标准音质切换",
-      "priority": "P2",
-      "phase": "第二阶段",
-      "backend_test_steps": [
-        "1. curl -X PUT http://localhost:3000/api/user/preferences -d '{\"quality\":\"high\"}' - 验证更新音质偏好返回 200",
-        "2. curl -X GET http://localhost:3000/api/user/preferences - 验证quality为high"
-      ],
+      "description": "加载优化 - 骨架屏组件",
+      "backend_test_steps": [],
       "frontend_test_steps": [
-        "1. 打开播放器页面",
-        "2. 打开音质设置",
-        "3. 切换到高清音质",
-        "4. 验证显示'高清'标识",
-        "5. 退出页面重新进入",
-        "6. 验证音质偏好保持为高清"
+        "1. 刷新首页",
+        "2. 验证骨架屏正常显示",
+        "3. 验证数据加载完成后骨架屏消失",
+        "4. 验证内容正常渲染"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 10,
-      "description": "离线缓存 - 下载到本地离线听",
-      "priority": "P2",
-      "phase": "第二阶段",
-      "backend_test_steps": [
-        "1. curl -X GET http://localhost:3000/api/downloads - 验证获取下载列表接口返回 200"
-      ],
+      "description": "加载优化 - 图片懒加载",
+      "backend_test_steps": [],
       "frontend_test_steps": [
-        "1. 在播放器页面点击下载按钮",
-        "2. 验证显示下载进度",
-        "3. 等待下载完成",
-        "4. 进入'我的下载'页面",
-        "5. 验证已下载的音频显示在列表中",
-        "6. 开启飞行模式",
-        "7. 点击离线音频播放",
-        "8. 验证离线播放正常"
+        "1. 进入包含多张图片的列表页面",
+        "2. 验证首屏图片正常加载",
+        "3. 滚动页面",
+        "4. 验证下方图片进入可视区时加载",
+        "5. 滚动回顶部",
+        "6. 验证图片已缓存不会重复加载"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 11,
-      "description": "断点续传 - 大文件下载断点续传",
-      "priority": "P2",
-      "phase": "贯穿全程",
+      "description": "全局搜索 - 搜索API",
       "backend_test_steps": [
-        "1. curl -X POST http://localhost:3000/api/downloads/check -d '{\"audioId\":\"test\",\"downloaded\":1024000}' - 验证断点查询返回正确信息"
+        "1. curl http://localhost:3000/api/search?q=test - 验证搜索接口",
+        "2. curl http://localhost:3000/api/search?q=故事 - 验证中文搜索",
+        "3. curl http://localhost:3000/api/search?q= - 验证空关键词处理"
       ],
       "frontend_test_steps": [
-        "1. 开始下载一个大音频文件",
-        "2. 在下载过程中关闭页面中断下载",
-        "3. 重新进入下载页面",
-        "4. 验证显示'继续下载'按钮",
-        "5. 点击继续下载",
-        "6. 验证从断点处继续下载"
+        "1. 进入search搜索页面",
+        "2. 输入搜索关键词",
+        "3. 验证搜索结果列表正常显示",
+        "4. 验证搜索结果相关性"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 12,
-      "description": "多端数据同步 - 多端数据实时同步",
-      "priority": "P2",
-      "phase": "贯穿全程",
+      "description": "全局搜索 - search页面开发",
       "backend_test_steps": [
-        "1. curl -X POST http://localhost:3000/api/favorites -d '{\"audioId\":\"sync-test\"}' - 添加收藏",
-        "2. curl -X GET http://localhost:3000/api/favorites - 验证收藏添加成功",
-        "3. curl -X PUT http://localhost:3000/api/player/progress -d '{\"audioId\":\"sync-test\",\"progress\":50}' - 更新播放进度"
+        "1. curl http://localhost:3000/api/search?q=小说 - 验证搜索结果正确返回"
       ],
       "frontend_test_steps": [
-        "1. 在H5端收藏一个音频",
-        "2. 在小程序端打开收藏页面",
-        "3. 验证收藏列表包含刚添加的音频",
-        "4. 在H5端播放并暂停在1分钟位置",
-        "5. 在小程序端打开同一音频",
-        "6. 验证显示从1分钟位置继续播放"
+        "1. 进入search搜索页面",
+        "2. 验证搜索历史记录显示",
+        "3. 验证热门推荐显示",
+        "4. 输入关键词进行搜索",
+        "5. 点击搜索结果进入player页面"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 13,
-      "description": "评论打分 - 对内容评论评分",
-      "priority": "P2",
-      "phase": "第三阶段",
+      "description": "内容分类 - 分类管理API",
       "backend_test_steps": [
-        "1. curl -X GET http://localhost:3000/api/comments/test-audio-1 - 验证获取评论列表接口返回 200",
-        "2. curl -X POST http://localhost:3000/api/comments -d '{\"audioId\":\"test-audio-1\",\"content\":\"很好听\",\"rating\":5}' - 验证发表评论接口返回 200",
-        "3. curl -X GET http://localhost:3000/api/comments/test-audio-1 - 验证评论已添加"
+        "1. curl http://localhost:3000/api/categories - 验证获取分类列表",
+        "2. curl http://localhost:3000/api/categories/1 - 验证获取分类下音频",
+        "3. curl http://localhost:3000/api/categories/999 - 验证无效分类ID处理"
       ],
       "frontend_test_steps": [
-        "1. 打开播放器页面",
-        "2. 点击评论按钮",
-        "3. 输入评论内容'非常棒的声音'",
-        "4. 选择5星评分",
-        "5. 点击提交",
-        "6. 验证评论显示在评论区",
-        "7. 验证评分为5星"
+        "1. 进入index首页",
+        "2. 验证分类标签显示正确",
+        "3. 点击某个分类",
+        "4. 验证只显示该分类下的音频"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 14,
-      "description": "消息通知 - 新内容推送、会员优惠",
-      "priority": "P3",
-      "phase": "第三阶段",
+      "description": "内容分类 - 分类筛选",
       "backend_test_steps": [
-        "1. curl -X GET http://localhost:3000/api/notifications - 验证获取消息列表接口返回 200"
+        "1. curl http://localhost:3000/api/categories/2 - 验证分类2音频列表"
       ],
       "frontend_test_steps": [
-        "1. 进入设置页面",
-        "2. 找到消息通知开关",
-        "3. 开启消息通知",
-        "4. 验证弹出通知权限申请",
-        "5. 授权后收到推送消息",
-        "6. 点击消息通知",
-        "7. 验证跳转到对应页面"
+        "1. 在index页面切换不同分类标签",
+        "2. 验证列表内容随分类变化",
+        "3. 验证分类筛选准确性"
       ],
       "status": "init",
       "passes": false
     },
     {
       "id": 15,
-      "description": "个性化主题 - 深色/浅色主题切换",
-      "priority": "P3",
-      "phase": "第三阶段",
+      "description": "音质选择 - 音质切换逻辑",
+      "backend_test_steps": [
+        "1. curl -X PUT http://localhost:3000/api/user/preferences -H 'Content-Type: application/json' -d '{\"userId\":\"test-user\",\"quality\":\"high\"}' - 验证设置高品质",
+        "2. curl http://localhost:3000/api/user/preferences?userId=test-user - 验证获取偏好确认"
+      ],
+      "frontend_test_steps": [
+        "1. 打开player页面",
+        "2. 点击音质选择按钮",
+        "3. 切换到高音质",
+        "4. 验证音质切换生效",
+        "5. 刷新页面验证音质设置已保存"
+      ],
+      "status": "init",
+      "passes": false
+    },
+    {
+      "id": 16,
+      "description": "离线缓存 - 下载管理",
+      "backend_test_steps": [
+        "1. curl http://localhost:3000/api/downloads - 验证获取下载列表",
+        "2. curl http://localhost:3000/api/downloads/check - 验证检查下载状态"
+      ],
+      "frontend_test_steps": [
+        "1. 进入favorites页面",
+        "2. 选择一个音频点击下载",
+        "3. 验证下载进度显示",
+        "4. 验证下载完成后状态更新"
+      ],
+      "status": "init",
+      "passes": false
+    },
+    {
+      "id": 17,
+      "description": "离线缓存 - 离线播放",
+      "backend_test_steps": [
+        "1. curl http://localhost:3000/api/downloads - 验证下载列表接口"
+      ],
+      "frontend_test_steps": [
+        "1. 进入favorites页面",
+        "2. 验证已下载音频显示下载状态",
+        "3. 关闭网络连接",
+        "4. 点击已下载音频进行播放",
+        "5. 验证离线播放正常"
+      ],
+      "status": "init",
+      "passes": false
+    },
+    {
+      "id": 18,
+      "description": "评论打分 - 评论API",
+      "backend_test_steps": [
+        "1. curl -X POST http://localhost:3000/api/comments -H 'Content-Type: application/json' -d '{\"userId\":\"test-user\",\"audioId\":\"audio-004\",\"content\":\"很好听\",\"rating\":5}' - 验证发表评论",
+        "2. curl http://localhost:3000/api/comments/audio-004 - 验证获取评论列表",
+        "3. curl -X POST http://localhost:3000/api/comments -H 'Content-Type: application/json' -d '{\"userId\":\"test-user2\",\"audioId\":\"audio-004\",\"content\":\"不错\",\"rating\":4}' - 添加更多评论"
+      ],
+      "frontend_test_steps": [
+        "1. 打开player页面",
+        "2. 滑动到评论区",
+        "3. 验证评论列表显示",
+        "4. 输入评论内容并打分",
+        "5. 点击提交",
+        "6. 验证新评论显示在列表中"
+      ],
+      "status": "init",
+      "passes": false
+    },
+    {
+      "id": 19,
+      "description": "消息通知 - 通知API",
       "backend_test_steps": [
-        "1. curl -X PUT http://localhost:3000/api/user/preferences -d '{\"theme\":\"dark\"}' - 验证更新主题偏好返回 200",
-        "2. curl -X GET http://localhost:3000/api/user/preferences - 验证theme为dark"
+        "1. curl http://localhost:3000/api/notifications - 验证获取通知列表",
+        "2. curl -X POST http://localhost:3000/api/notifications/read -H 'Content-Type: application/json' -d '{\"id\":\"notif-001\"}' - 验证标记已读"
       ],
       "frontend_test_steps": [
-        "1. 进入设置页面",
-        "2. 点击主题设置",
-        "3. 选择深色主题",
-        "4. 验证页面切换为深色模式",
-        "5. 退出页面重新进入",
-        "6. 验证主题保持为深色"
+        "1. 进入任意页面",
+        "2. 验证通知图标显示",
+        "3. 点击通知图标",
+        "4. 验证通知列表正常显示",
+        "5. 点击某条通知",
+        "6. 验证已读状态更新"
       ],
       "status": "init",
       "passes": false
     }
+    
   ]
 }

+ 4 - 3
init.sh

@@ -26,11 +26,12 @@ sleep 8
 
 # 5. 验证后端服务
 echo "✅ 验证后端服务..."
-curl -f http://localhost:8000/health || echo "后端服务启动失败"
-curl -f http://localhost:8000/api/audio/list || echo "API服务可能未就绪"
+curl -f http://localhost:3000/health || echo "后端服务启动失败"
+curl -f http://localhost:3000/api/audio/list || echo "API服务可能未就绪"
 
 echo ""
 echo "🎉 服务启动完成!"
-echo "后端服务: http://localhost:8000"
+echo "后端服务: http://localhost:3000"
 echo "前端服务: npm run dev:h5 (在 my-uniapp-vue3 目录)"
+echo "前端访问: http://localhost:5173"
 echo "后端进程PID: $BACKEND_PID"

+ 1 - 0
my-uniapp-vue3/vite.config.ts

@@ -11,5 +11,6 @@ export default defineConfig({
         changeOrigin: true,
       },
     },
+    port: 5173,
   },
 });