Files
vscode-workbench/.trae/specs/baidu-translate-usage-tracking/checklist.md
T

18 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
- [x] TranslateUsage 模型正确定义,包含所有必需字段(user、translate_type、from_lang、to_lang、text_length、created_at、ip_address)
- [x] user 字段为可空外键,关联到 FUser 模型
- [x] translate_type 使用 choices 限制为 text/detect/image/audio
- [x] 迁移文件成功生成且无错误
- [x] TranslateUsage 在 Admin 后台正确注册,支持筛选和搜索
- [x] record_translate_usage Celery 任务正确创建使用量记录
- [x] 文本翻译成功后调用使用量记录(translate_type=text)
- [x] 语种识别成功后调用使用量记录(translate_type=detect)
- [x] 图片翻译任务提交成功后调用使用量记录(translate_type=image)
- [x] 语音翻译任务提交成功后调用使用量记录(translate_type=audio)
- [x] 已认证用户的记录正确关联到用户
- [x] 匿名用户的记录 user 为 NULL 但 IP 正确记录
- [x] GET /api/baiduFanyi/usage/ 返回今日次数和累计次数
- [x] 使用量查询 API 支持已登录用户和匿名用户两种场景
- [x] 前端页面顶部展示"今日翻译 X 次 | 累计 Y 次"
- [x] 国际化文案已添加到 zh.json、en.json 等文件
- [x] 所有 API 视图的 permission_classes 保持 AllowAny 不变