docs/api目录文档分类和补全

---------

Co-authored-by: guke <guke@autohome.com.cn>
Reviewed-on: #111
This commit was merged in pull request #111.
This commit is contained in:
2026-07-03 15:00:37 +08:00
parent ee132aa93b
commit a563c1ca4b
102 changed files with 2418 additions and 217 deletions
+48
View File
@@ -0,0 +1,48 @@
# GET /api/v1/invite/me — 我的邀请信息
> 所属:Invite 组(前缀 `/api/v1/invite` | 鉴权:Bearer | [← 返回 API 索引](../README.md)
获取当前用户的邀请码、分享链接、已邀人数、累计获得金币/奖励金,以及 7 天一轮的倒计时信息。
## 入参
无(`user_id` 从 JWT 取)。
## 出参
响应 `200`:`InviteInfoOut`
| 字段 | 类型 | 说明 |
|---|---|---|
| `invite_code` | string | 我的邀请码(6-8 位) |
| `share_url` | string | 落地页链接(含 `?ref=`),前端据此生成二维码 + 复制分享 |
| `invited_count` | int | 已成功邀请人数 |
| `coins_earned` | int | 累计从邀请获得的金币(v1 口径) |
| `reward_balance_cents` | int | v2 可提现邀请奖励金(分) |
| `reward_withdrawn_cents` | int | v2 累计提现成功的邀请奖励金(分) |
| `countdown_days_left` | int | v2 本轮剩余天数(7 天 1 轮) |
| `countdown_is_fresh_round` | bool | 是否刚进入新一轮(非首轮第 1 天) |
| `countdown_text` | string | 倒计时展示文案(前端直接显示,新轮含换行) |
Mock 出参:
```json
{
"invite_code": "A3F8K2",
"share_url": "https://app.shaguabijia.com/dl.html?ref=A3F8K2",
"invited_count": 5,
"coins_earned": 50000,
"reward_balance_cents": 3200,
"reward_withdrawn_cents": 1800,
"countdown_days_left": 4,
"countdown_is_fresh_round": false,
"countdown_text": "还剩 4 天"
}
```
## 错误码
- `401` 未鉴权 / token 失效
## 说明
- 首次调用自动生成邀请码(幂等)
- v2 奖励金与现金隔离(`reward_balance_cents` 独立于 `cash_balance_cents`
- 7 天 1 轮倒计时:新用户从注册日起算