Conversation
Collaborator
Author
|
server.js - 添加索引、缓存、路由注册 |
rqhuang2006
reviewed
Mar 4, 2026
Collaborator
rqhuang2006
left a comment
There was a problem hiding this comment.
可能存在以下问题,请注意:
server.js 第 145 行的 app.listen 缺少闭合的 });。把 app.get('/api/v1/segments/user'...) 错误地包裹进了第一个 app.listen 的回调函数里?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
• 添加数据库索引:9个索引,涵盖 videos、ad_segments、segment_votes、users、user_points 表
• 实现缓存机制:创建 cache.js,支持 TTL 自动过期、主动删除
• 优化查询语句:批量查询、统计查询均添加缓存,设置结果限制,优化 JOIN
• 用户导出 API:GET /api/v1/user/export,返回用户个人数据和标注记录
• 管理员导出 API:GET /api/v1/admin/export/all,返回全系统数据,需要管理员权限验证