Files
guke a563c1ca4b @ (#111)
docs/api目录文档分类和补全

---------

Co-authored-by: guke <guke@autohome.com.cn>
Reviewed-on: #111
2026-07-03 15:00:37 +08:00

34 lines
949 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# GET /api/v1/coupon/stats — 累计领券数
> 所属:Coupon 组(前缀 `/api/v1/coupon` | 鉴权:Bearer | [← 返回 API 索引](../README.md)
「我的」页战绩卡「领取优惠券 X 张」数据源。该登录用户累计领到的券数(`SUM(claimed_count)`,与领券完成时给用户看的「本次领了 N 张」同源)。
**鉴权(CurrentUser** — 区别于同文件不鉴权的 `/step` 透传与 `/prompt` 频控:个人战绩按 `user_id` 聚合,必须有登录态。
## 入参
无(`user_id` 从 JWT 取)。
## 出参
响应 `200`:`CouponStatsOut`
| 字段 | 类型 | 说明 |
|---|---|---|
| `coupon_count` | int | 累计领到的券张数 |
Mock 出参:
```json
{
"coupon_count": 42
}
```
## 错误码
- `401` 未鉴权 / token 失效
## 说明
- 口径:`SUM(claimed_count)` — 各成功领券记录 pricebot 展示张数之和
- 只算登录用户,按 `user_id` 聚合(非 device_id