feat: add points risk report

This commit is contained in:
Codex
2026-06-30 15:12:32 +08:00
parent a5a2caa2e9
commit 87f4cf9c4e
15 changed files with 522 additions and 25 deletions

View File

@@ -69,7 +69,7 @@
| 学生预设头像 | 可联调 | `GET/PATCH /api/profile/me`;仅支持 `avatarPreset=male/female` 和系统默认头像路径,后端拒绝直接 `PATCH avatarUrl`,不提供用户头像上传 |
| 题目反馈/纠错 | 可联调 | `GET/POST /api/profile/feedbacks`,题目必须属于当前租户;租户后台可处理状态流转,处理结果和奖励积分会写入用户站内通知 |
| 签到积分 | 可联调 | `POST /api/profile/check-in``GET /api/profile/score-events`;积分流水幂等、事务加锁,重复签到不重复加分;租户可用 `taskType=daily_check_in` 积分任务配置基础/连续签到奖励,后端自动写积分流水和领取记录;真实签到成功会触发 `check_in``score` 规则勋章自动发放,重复签到不重复发放 |
| 积分活动/兑换 | 可联调 | `GET /api/profile/activity-tasks``POST /api/profile/activity-tasks/claim``GET /api/profile/exchange-items``POST /api/profile/exchange-items/redeem`;复用 `user_score_events` 积分账本,任务领取和兑换均事务加锁;手动/练习/单词/模考类任务有后端证据校验,反馈解决等系统任务禁止学生自领;兑换支持库存、个人限购、余额校验、幂等 key、优惠券履约、兑换订单和完成/待履约站内通知 |
| 积分活动/兑换 | 可联调 | `GET /api/profile/activity-tasks``POST /api/profile/activity-tasks/claim``GET /api/profile/exchange-items``POST /api/profile/exchange-items/redeem``GET /api/tenant-admin/points-risk-report`;复用 `user_score_events` 积分账本,任务领取和兑换均事务加锁;手动/练习/单词/模考类任务有后端证据校验,反馈解决等系统任务禁止学生自领;兑换支持库存、个人限购、余额校验、幂等 key、优惠券履约、兑换订单和完成/待履约站内通知;租户后台积分风控报表按 7/30/90 天只读聚合异常用户、大额积分事件、高频任务和大额兑换,不直接改账、封禁或冻结权益 |
| 学生勋章 | 可联调 | `GET /api/profile/badges`;支持分类筛选、已解锁/未解锁展示,后端只返回当前租户当前用户的勋章状态;签到连续天数、积分阈值、反馈解决、积分活动、练习次数、单词掌握和模考成绩规则已支持自动发放,自动/手动获得勋章会写入用户站内通知 |
| 学生站内通知 | 可联调 | `GET /api/profile/notifications``POST /api/profile/notifications/status`;学生只能查看和更新自己的通知,支持未读/已读/忽略/归档、类型筛选和状态汇总 |
@@ -137,7 +137,7 @@
| 登录 provider 配置 | 可联调 | `/api/tenant-admin/auth-providers` |
| 密钥掩码/引用 | 迁移期 | API 有掩码,生产前要做 KMS/Vault 或 envelope encryption |
| 活动、Banner、FAQ、公告 | 可联调 | `/api/tenant-admin/banners``faqs``announcements` |
| 积分任务/兑换配置 | 可联调 | `/api/tenant-admin/point-activity-tasks``point-activity-claims``point-exchange-items``point-exchange-orders`;使用 `marketing:points:read/write` 或兼容 `marketing:read/write` 权限,支持任务配置、兑换商品配置、领取记录、兑换订单、审计跨租户拒绝 |
| 积分任务/兑换配置 | 可联调 | `/api/tenant-admin/point-activity-tasks``point-activity-claims``point-exchange-items``point-exchange-orders``points-risk-report`;使用 `marketing:points:read/write` 或兼容 `marketing:read/write` 权限,积分风控支持 `marketing:points:risk:read` 且兼容 `marketing:points:read`支持任务配置、兑换商品配置、领取记录、兑换订单、只读风控报表、审计跨租户拒绝 |
| 勋章管理/发放 | 可联调 | `/api/tenant-admin/badges``/api/tenant-admin/badge-grants`;支持后台维护、同 `legacyId` 幂等更新、手动发放、重复发放幂等、租户隔离和权限点 `badges:read/write/grant``unlockType=check_in/score/feedback_resolved/activity_reward/practice_count/vocabulary_mastered/mock_exam_score` 会由签到、积分奖励、反馈解决、活动任务、练习交卷、单词掌握和模考成绩事件自动发放,并写入用户站内通知 |
| 考试日期维护 | 可联调 | `/api/tenant-admin/exam-dates`,支持地区维度维护和公开倒计时展示 |
| 题目反馈处理 | 可联调 | `/api/tenant-admin/feedbacks``feedbacks/status``feedbacks/events`;支持状态流转、处理备注、审计事件、幂等奖励积分和用户站内通知 |