Files
shaguabijia-app-server/docs/api/admin-wallet-coin-transactions.md
T
ouzhou 0e42e96ddb docs(admin): 补充管理后台 API 与数据库文档 (#12)
新增 admin 模块接口文档(auth login/me、admins CRUD、audit-logs、feedback 处理、stats 概览、user coins/detail/status、wallet 流水、withdraw 对账/刷新/列表) + admin_user/admin_audit_log 两张表文档,更新 api/database README 索引。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: OuYingJun1024 <1034284404@qq.com>
Reviewed-on: #12
Co-authored-by: ouzhou <ouzhou@wonderable.ai>
Co-committed-by: ouzhou <ouzhou@wonderable.ai>
2026-06-06 15:58:23 +08:00

36 lines
1.6 KiB
Markdown
Raw 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 /admin/api/wallet/coin-transactions — 金币流水(游标分页)
> 所属:Admin·钱包 组(前缀 `/admin/api/wallet` | 鉴权:Bearer admin_token(角色:任意已登录管理员,仅需 `get_current_admin`,无 `require_role` | [← 返回 API 索引](./README.md)
跨用户查询全量金币流水,可按 `user_id` / `biz_type` 过滤。游标分页(`id` 倒序)。
## 入参(query
| 字段 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
| `user_id` | int | ❌ | null | 按用户过滤;不传则查全量 |
| `biz_type` | string | ❌ | null | 按业务类型过滤 |
| `limit` | int | ❌ | 20 | 1100 |
| `cursor` | int | ❌ | null | 上一页 next_cursor(查 `id < cursor` |
## 出参
响应 `200`:`{ items: CoinTxnOut[], next_cursor: int|null }``next_cursor=null` 表示末页)
**CoinTxnOut**
| 字段 | 类型 | 说明 |
|---|---|---|
| `id` | int | 流水主键 |
| `user_id` | int | 所属用户 |
| `amount` | int | 金币变动量(正/负,单位:金币个数,非分) |
| `balance_after` | int | 本次变动后金币余额 |
| `biz_type` | string | 业务类型 |
| `ref_id` | string \| null | 关联业务 ID |
| `remark` | string \| null | 备注 |
| `created_at` | datetime | 创建时间(ISO 8601 UTC |
## 错误码
- `401` 未带/无效/过期 admin token、管理员被禁用(响应头带 `WWW-Authenticate: Bearer`
- `422` query 参数校验失败(如 `limit` 越界、类型错误)
## 说明
关联 [coin_transaction](../database/coin_transaction.md)。金币为个数计量,非分。