1893c01f54
- SavingsBattle 仓储/schema/接口新增 compare_count(= 有效记录数,与 order_count 同源) - 更新 docs/api/savings-battle.md 与 tests/test_welfare.py 断言 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
904 B
904 B
GET /api/v1/savings/battle — 省钱战绩
所属:Savings 组(前缀
/api/v1/savings) | 鉴权:Bearer | ← 返回 API 索引
入参
无(用户由 token 确定)。
出参
响应 200:SavingsBattleOut
| 字段 | 类型 | 说明 |
|---|---|---|
week_saved_cents |
int | 本周已省(分) |
beat_percent |
int | 超过百分之多少用户 |
streak_days |
int | 连续省钱天数 |
compare_count |
int | 累计完成比价次数(= 比价上报记录数;有真实 compare 记录用真实数,否则 demo 兜底) |
说明
「我的」页「省钱战绩」卡数据源(三列:本周已省 / 完成比价 / 连续比价)。compare_count 与 /summary 的 order_count 同源(均 = 有效记录数),对应原型「完成比价(次)」列。接口已通但无真实业务写入时走 demo 兜底(seed 约 23 条)。