Files
shaguabijia-app-server/docs/database/ad_feed_reward_record.md
T
ouzhou d7c29c0883 feat(coin): 金币数值体系二期——看广告按 eCPM 发奖 + ad_session_id 幂等 + 签到膨胀固定金币 (#28)
- rewards: 激励视频实发改按 calculate_ad_reward_coin(eCPM, 当日第N次) 公式;AD_REWARD_COIN/MAX_AD_REWARD_COIN 降为历史兼容口径;新增 SIGNIN_BOOST_COIN=2000

- 签到膨胀: Day1-13 看完激励视频额外发固定金币、Day14 不允许 (signin.py / signin-boost)

- ad_session_id 幂等: ad_ecpm/ad_reward/ad_feed_reward 记录加 ad_session_id 列 + 唯一索引(新迁移 coin_reward_phase2 / ad_feed_reward_session)

- ad.py + schemas + repositories: ecpm-report / feed-reward / reward-status / test-grant 改造;config_schema 增 signin_boost_coin;admin stats overview 补充

- 同步 docs/api + docs/database + docs/integrations/pangle 及 tests(test_ad_reward / test_welfare)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: OuYingJun1024 <1034284404@qq.com>
Reviewed-on: #28
Co-authored-by: ouzhou <ouzhou@wonderable.ai>
Co-committed-by: ouzhou <ouzhou@wonderable.ai>
2026-06-09 01:56:47 +08:00

1.3 KiB
Raw Blame History

ad_feed_reward_record — 信息流广告奖励记录

点位 2 的奖励记录。每条记录对应客户端完成的一次信息流广告展示/播放事件。

字段

字段 类型 约束 说明
id Integer PK 自增主键
client_event_id String(64) UNIQUE, NOT NULL 客户端幂等事件 id
ad_session_id String(64) index, nullable 客户端生成的一次信息流广告会话 id
user_id Integer FK → user.id, index, NOT NULL 用户
reward_date String(10) index, NOT NULL 北京时间日期 YYYY-MM-DD
duration_seconds Integer NOT NULL 实际展示/播放秒数
unit_count Integer NOT NULL duration_seconds // 10 得到的奖励份数
ecpm_raw String(32) NOT NULL 客户端上报 eCPM 原始值
adn String(32) nullable 实际投放 ADN
slot_id String(64) nullable 实际展示代码位
coin Integer NOT NULL 实发金币,capped 时为 0
status String(16) NOT NULL granted / capped
created_at DateTime index, NOT NULL 创建时间

约束

  • UNIQUE(client_event_id):同一完成事件重试不重复发奖。

关联

  • 入账时写 coin_transaction.biz_type=feed_ad_rewardref_id=client_event_id