Commit Graph

2 Commits

Author SHA1 Message Date
OuYingJun1024 32d04d7008 fix(welfare): 消息提醒可重复领取并发重复发放修复 + review 清理
代码 review(本分支未提交 WIP)发现并修复:
- 高: enable_notification 可重复领取的发放是无锁读-算-写,并发/连点会算出同一序号
  双倍发钱。给 coin_transaction 加 (user_id,biz_type,ref_id) 部分唯一索引(仅 task_*),
  claim 撞唯一约束→IntegrityError 回滚兜底成 AlreadyClaimedError(409),不双发。
  配套 alembic 迁移 coin_txn_task_ref_uq(挂 head=drop_force_onboarding)。
- 中: 加领取封顶 rewards.notification_max_claims(减半到底=1 后不再可领),挡通知一直关着
  时无限刷 1 金币;列表领满后 claimed 置 True 供客户端隐藏。
- 中: _notification_grant_times 改只数 amount>0 流水,避免日后冲正/负向流水把次数算大。
- 低: 合并 ops_marquee._nickname 两个一字不差的重复分支。
- 文档: tasks-list / tasks-claim 补可重复领取/逐次减半/409 语义。
- 测试: 新增「领满到底→409 + claimed=True」用例;test_welfare 全绿(3 个 proxy 失败
  为 pre-existing httpx mock 问题,与本次无关)。

注: review 标的「do_signin 未归一化老 cycle_day」经验算为非 bug(x%LEN+1 对越界值
本就周期正确,且与 get_status 预览公式恒等),未改。

含本分支签到7天改制/任务文案/膨胀金币等 WIP。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 23:39:27 +08:00
OuYingJun1024 18ab7eab92 docs(api): 补全福利/钱包/提现/签到/任务/省钱/看广告 21 个接口文档
按 docs/api 一接口一文件约定新增:
- 钱包(11): account / coin-transactions / cash-transactions / exchange-info / exchange / bind-wechat / unbind-wechat / withdraw-info / withdraw / withdraw/status / withdraw-orders
- 签到(2): status / 执行签到
- 任务(2): list / {task_key}/claim
- 省钱(3): summary / battle / records
- 看广告发奖(3): pangle-callback(S2S验签) / reward-status / test-grant(仅联调)
- README 索引补 12–32 行 + 新增「游标分页约定」+ 修正鉴权说明 + 注明金额以分为单位

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 17:50:01 +08:00