feat(ad-reward): reward-status 加本轮 3 次冷却字段 (round_count + cooldown_until) #5

Merged
marco merged 1 commits from feat/welfare-video-round-cooldown into main 2026-05-29 15:45:52 +08:00

让客户端 4 态任务行 CTA (Normal/Loading/Capped/CoolingDown) 与 ExitReward
弹窗 limit note (本轮看完/今日看完 二选一) 都由后端权威派生, 跨设备 / 重装 /
杀进程都一致, 客户端不再依赖 in-memory 本地存储。

  • core/rewards.py: 加 VIDEO_ROUND_REQUIRED_COUNT=3 / VIDEO_ROUND_COOLDOWN_SECONDS=600
  • repositories/ad_reward.py: today_status 从 3-tuple 扩成 5-tuple,
    从已有 created_at 字段按 ORDER BY DESC + OFFSET round_count 派生最近一个
    已完成轮末尾时间; 零新字段零新表
  • schemas/ad.py: AdRewardStatusOut + TestGrantOut 加 round_count + cooldown_until
  • api/v1/ad.py: reward_status / test_grant 接 5-tuple
  • tests: 加 4 个覆盖 (初始 / 未达一轮 / 刚达一轮进冷却 / 冷却已过)
  • docs/api/ad-reward-status.md: 补字段说明 + 客户端 4 态 CTA 推导规则 +
    "冷却仅 UX, 发奖不受影响" 注解

冷却是 UX 约束: pangle-callback 发奖只看 daily_limit, 冷却期间穿山甲
回调照常发奖, 不另设拒发分支。

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

让客户端 4 态任务行 CTA (Normal/Loading/Capped/CoolingDown) 与 ExitReward 弹窗 limit note (本轮看完/今日看完 二选一) 都由后端权威派生, 跨设备 / 重装 / 杀进程都一致, 客户端不再依赖 in-memory 本地存储。 - core/rewards.py: 加 VIDEO_ROUND_REQUIRED_COUNT=3 / VIDEO_ROUND_COOLDOWN_SECONDS=600 - repositories/ad_reward.py: today_status 从 3-tuple 扩成 5-tuple, 从已有 created_at 字段按 ORDER BY DESC + OFFSET round_count 派生最近一个 已完成轮末尾时间; 零新字段零新表 - schemas/ad.py: AdRewardStatusOut + TestGrantOut 加 round_count + cooldown_until - api/v1/ad.py: reward_status / test_grant 接 5-tuple - tests: 加 4 个覆盖 (初始 / 未达一轮 / 刚达一轮进冷却 / 冷却已过) - docs/api/ad-reward-status.md: 补字段说明 + 客户端 4 态 CTA 推导规则 + "冷却仅 UX, 发奖不受影响" 注解 冷却是 UX 约束: pangle-callback 发奖只看 daily_limit, 冷却期间穿山甲 回调照常发奖, 不另设拒发分支。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ghost added 1 commit 2026-05-29 13:31:02 +08:00
让客户端 4 态任务行 CTA (Normal/Loading/Capped/CoolingDown) 与 ExitReward
弹窗 limit note (本轮看完/今日看完 二选一) 都由后端权威派生, 跨设备 / 重装 /
杀进程都一致, 客户端不再依赖 in-memory 本地存储。

- core/rewards.py: 加 VIDEO_ROUND_REQUIRED_COUNT=3 / VIDEO_ROUND_COOLDOWN_SECONDS=600
- repositories/ad_reward.py: today_status 从 3-tuple 扩成 5-tuple,
  从已有 created_at 字段按 ORDER BY DESC + OFFSET round_count 派生最近一个
  已完成轮末尾时间; 零新字段零新表
- schemas/ad.py: AdRewardStatusOut + TestGrantOut 加 round_count + cooldown_until
- api/v1/ad.py: reward_status / test_grant 接 5-tuple
- tests: 加 4 个覆盖 (初始 / 未达一轮 / 刚达一轮进冷却 / 冷却已过)
- docs/api/ad-reward-status.md: 补字段说明 + 客户端 4 态 CTA 推导规则 +
  "冷却仅 UX, 发奖不受影响" 注解

冷却是 UX 约束: pangle-callback 发奖只看 daily_limit, 冷却期间穿山甲
回调照常发奖, 不另设拒发分支。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ghost requested review from marco 2026-05-29 13:31:02 +08:00
marco merged commit e69e244de7 into main 2026-05-29 15:45:52 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WonderableAI/shaguabijia-app-server#5