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
@
This commit is contained in:
guke
2026-07-03 14:56:50 +08:00
parent ee132aa93b
commit b23335d5fb
102 changed files with 2418 additions and 217 deletions
+77
View File
@@ -0,0 +1,77 @@
# GET /admin/api/stats/overview — 大盘核心指标
> 所属:Admin·数据大盘 组(前缀 `/admin/api/stats` | 鉴权:Bearer admin_token(角色:任意已登录管理员,无 require_role | [← 返回 API 索引](../README.md)
## 入参
## 出参
响应 `200`:`DashboardOverview`(全局只读聚合,六大块嵌套)
| 字段 | 类型 | 说明 |
|---|---|---|
| `users` | DashboardUsers | 用户指标 |
| `coins` | DashboardCoins | 金币指标 |
| `cash` | DashboardCash | 现金/提现指标 |
| `comparison` | DashboardComparison | 比价指标 |
| `feedback` | DashboardFeedback | 反馈指标 |
| `cps` | DashboardCps | CPS 收入(P2 未接入) |
**DashboardUsers**
| 字段 | 类型 | 说明 |
|---|---|---|
| `total` | int | 用户总数 |
| `active` | int | 状态 `active` 数 |
| `disabled` | int | 状态 `disabled` 数 |
| `deleted` | int | 状态 `deleted` 数 |
| `new_today` | int | 今日新增(按北京时区切天的 `created_at`) |
| `dau` | int | 日活(今日有 `last_login_at`,北京时区切天) |
**DashboardCoins**
| 字段 | 类型 | 说明 |
|---|---|---|
| `granted_total` | int | 累计发放金币(coin_transaction 中所有 `amount > 0` 之和;负数兑换/扣减不计) |
| `reward_video_coin_total` | int | 普通激励视频累计发放金币(`biz_type=reward_video/ad_reward`) |
| `reward_video_watch_count` | int | 普通激励视频有效发奖视频数(`ad_reward_record.reward_scene=reward_video,status=granted`) |
| `feed_ad_coin_total` | int | 信息流广告累计发放金币(`biz_type=feed_ad_reward`) |
| `feed_ad_watch_count` | int | 信息流广告有效完成视频数(`ad_feed_reward_record.status=granted`) |
| `signin_coin_total` | int | 签到累计发放金币(`biz_type=signin`) |
| `signin_count` | int | 签到次数(`signin_record`) |
| `signin_boost_coin_total` | int | 签到膨胀累计发放金币(`biz_type=signin_boost`) |
| `signin_boost_watch_count` | int | 签到膨胀有效视频数(`signin_boost_record`) |
**DashboardCash**
| 字段 | 类型 | 说明 |
|---|---|---|
| `withdraw_success_cents` | int | 提现成功累计金额(分,`status=success` 之和) |
| `withdraw_pending_count` | int | 提现 `pending` 单数 |
| `withdraw_success_count` | int | 提现 `success` 单数 |
| `withdraw_failed_count` | int | 提现 `failed` 单数 |
**DashboardComparison**
| 字段 | 类型 | 说明 |
|---|---|---|
| `total` | int | 比价记录总数 |
| `success` | int | 比价成功数(`status=success`) |
| `success_rate` | float | 成功率 = success/total,保留 4 位小数;total 为 0 时返回 `0.0` |
**DashboardFeedback**
| 字段 | 类型 | 说明 |
|---|---|---|
| `new` | int | 待处理反馈数(`status=new`) |
**DashboardCps**
| 字段 | 类型 | 说明 |
|---|---|---|
| `available` | bool | CPS 数据是否可用(当前固定 `false`) |
| `note` | string | 说明文案(当前固定 `"CPS 转化数据未接入(P2)"`) |
## 错误码
- `401` 未带/无效/过期 admin token、管理员被禁用(头带 `WWW-Authenticate: Bearer`)
## 说明
- 全部为全局只读聚合(count / sum / DAU / 成功率),不改任何数据。
- `new_today` / `dau` 按**北京时区**(UTC+8)切天,其余金额/计数无时区概念。
- 金额单位:`*_cents` 为分;金币(`*_coin_total`/`granted_total`)为个数。
- CPS 收入数据源未接入(referral-link 只换链接,转化/佣金未回收),`cps` 恒为 `{available:false, note:...}`,前端显示"待接入"。
- 关联表:[user](../database/user.md) / [coin_transaction](../database/coin_transaction.md) / [withdraw_order](../database/withdraw_order.md) / [comparison_record](../database/comparison_record.md) / [feedback](../database/feedback.md)。