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 @
2.0 KiB
2.0 KiB
GET /api/v1/platform/stats — 首页三统计(全平台门面数字)
所属:Platform 组(前缀
/api/v1/platform) | 鉴权:无(登录前首页也要展示) | ← 返回 API 索引
客户端首页顶部「帮助用户 / 完成比价 / 累计节省」三个平台级数字。每个指标的展示模式由运营后台配(见 admin-dashboard-display),本接口只返回算好的结果值。
入参
无。
出参
响应 200:PlatformStatsOut
| 字段 | 类型 | 说明 |
|---|---|---|
help_users |
int | 帮助用户(人) |
total_compares |
int | 完成比价(次) |
total_saved_cents |
int | 累计节省(分),客户端 ÷100 显示「元」 |
说明
三指标各自独立选模式,且统一「定时刷新」:客户端看到的展示值只在「更新时间(按更新间隔)」对齐的北京钟点(anchor + k*间隔)刷新一次,平时不变。每次刷新按模式算新值:
- real:重新快照查库,再与保底值取大。
help_users=有过status='success'比价记录的去重用户数;total_compares=成功比价记录数;total_saved_cents=成功记录saved_amount_cents求和(只计0<saved≤300 元的条目,剔除 bug 异常大值);最终展示 =max(真实值, 运营配的 real_offset 保底值)。 - manual:取运营当前手填的固定值(改值到下个更新钟点生效)。
- random:在上次展示值上按方式增长——
mult×一个 [1.0,1.5] 随机倍率 /add+一个 [下限,上限] 随机绝对增量(跨几个钟点走几次)。 - 只增不减:默认门面数字不回退(real/manual 新值低于当前则保持),除非运营开「允许下降」。
计算逻辑见 app/repositories/ops_stat.py,模型见 app/models/ops_stat_config.py(表 ops_stat_config)。
上线初始播种为 manual + 客户端原写死门面值(12847 / 86532 / 37621.40 元),保证前后展示一致。