Files
shaguabijia-app-server/docs/api/ad/ad-test-grant.md
T
guke b23335d5fb @
docs: reorganize api docs into categorized subdirectories and fill missing docs

- Categorize 77 existing api docs into 16 business-domain subdirectories
  (auth/ad/wallet/coupon/compare/savings/signin/tasks/invite/user/
   device/platform/intent/meituan/other) plus admin/ and internal/
- Split admin/ into 7 sub-resource subdirectories (auth/users/wallet/
  withdraws/feedbacks/admins/ad) with 4 single-file docs at root
- Create 21 new docs covering 28 previously undocumented endpoints:
  ad/watch-report, wallet/transfer-auth (3 endpoints), coupon/session+
  stats+completed-today+prompt (7), invite/me+invitees+bind+landing-track,
  user/onboarding (2), platform/flags+ad-config+app-version,
  intent/step+precoupon/step, analytics/events, order/report,
  report/submit+records, feedback/config+records, trace/finalize
- Add mock request/response JSON examples to all new docs
- Create docs/README.md with full category index for LLM navigation
- Update docs/api/README.md: fix all links, add new endpoint rows,
  replace "no doc" markers with actual links
- Fix back-navigation links (./README.md -> ../README.md or
  ../../README.md) in all moved files
@
2026-07-03 14:56:50 +08:00

2.3 KiB
Raw Blame History

POST /api/v1/ad/test-grant — [仅本地联调]模拟穿山甲回调发奖

所属:Ad 组(前缀 /api/v1/ad | 鉴权:Bearer | 限流:同 IP ≤60 次/分 | ← 返回 API 索引

⚠️ 仅本地联调,受 AD_REWARD_TEST_GRANT_ENABLED 开关控制,生产必须关闭(默认 False → 一律 404)。

入参

请求体可省略;用户由 token 确定。

字段 类型 必填 默认 说明
reward_scene string reward_video 模拟发奖场景。reward_video=普通激励视频;signin_boost=签到膨胀
ad_session_id string(8~64) | null null 本次广告会话 id(与 ecpm-report 同值)。reward_video 场景生效:据此查回客户端已上报的真实 eCPM,走与正式发奖相同的公式发奖;查不到或 eCPM≤0(测试应用常返 0/假值)时兜底 200,保证本地联调仍出非零金币

出参

响应 200:TestGrantOut

字段 类型 说明
granted bool 本次是否真发了金币(达每日上限则 false)
status string granted / capped(达上限) / not_signed / already_boosted / last_day / unknown_scene
coin int 本次发放金币(capped 时 0
used_today int 今日已成功发奖次数
daily_limit int 每日发奖次数上限
remaining int 今日剩余可领次数
coin_per_ad int 历史兼容字段;正式发放按 eCPM 动态计算,当前返回 0

错误码

  • 404 开关未开(伪装不存在) / 用户不存在

说明

没公网、穿山甲 S2S 回调打不到本地时,debug 客户端看完广告后调它,直接走与 ad-pangle-callback 相同的发奖逻辑(每次新 trans_id,幂等 + 每日上限/今日膨胀一次)。

reward_scene=reward_video 时按上面 ad_session_id 查回的真实 eCPM 走金币公式发奖(取不到兜底 200)——便于本地用 admin 金币审计 核对「看广告→金币」是否按公式计算。

reward_scene=signin_boost 时复用签到膨胀业务规则:必须当天已签到、非第 14 天、当天未膨胀过,成功后写入 signin_boost 金币流水。它让已登录客户端能自助发奖 = 绕过反作弊,严禁在生产开启