d7c29c0883
- 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>
1.6 KiB
1.6 KiB
POST /api/v1/ad/feed-reward — 信息流广告完成后结算金币
点位 2:比价等待 / 领券信息流广告。每展示满 10 秒累计一份奖励,视频完成后一次性入账。
鉴权
需要 Bearer token。
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
client_event_id |
string | 是 | 客户端生成的幂等事件 id,8-64 字符 |
ad_session_id |
string|null | 否 | 客户端生成的一次信息流广告会话 id,用于对账/排查 |
ecpm |
string | 是 | 本条信息流广告 eCPM,按“元/千次展示”处理 |
duration_seconds |
int | 是 | 实际展示/播放秒数 |
adn |
string|null | 否 | 实际投放 ADN |
slot_id |
string|null | 否 | 实际展示代码位 |
响应
| 字段 | 类型 | 说明 |
|---|---|---|
granted |
bool | 本次是否入账;达上限时为 false |
status |
string | granted / capped |
coin |
int | 本次发放金币 |
unit_count |
int | 按 10 秒折算出的奖励份数 |
daily_limit |
int | 每日信息流展示次数上限,默认 500 |
计算口径
- 奖励份数:
duration_seconds // 10。 - 单份奖励:
eCPM / 1000 × 因子1(eCPM 档) × 因子2(当天累计份序号) × 10000,四舍五入为整数金币。 - eCPM 档:
0-100=0.1,101-200=0.3,201-400=0.4,>400=0.6。 - LT 档:第 1 份
2.0,第 2 份1.5,第 3 份1.3,第 4-10 份1.1,第 11 份及以后1.0。
数据写入
ad_feed_reward_record新增一行。- 入账时
coin_account增加余额。 - 入账时
coin_transaction写入biz_type=feed_ad_reward。