cce3a01de1
Co-authored-by: OuYingJun1024 <1034284404@qq.com> Reviewed-on: #49 Co-authored-by: ouzhou <ouzhou@wonderable.ai> Co-committed-by: ouzhou <ouzhou@wonderable.ai>
36 lines
1.6 KiB
Markdown
36 lines
1.6 KiB
Markdown
# 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 | 1–100 |
|
||
| `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 | 创建时间(北京 wall-clock naive,非 UTC;前端按字面显示,不做时区换算) |
|
||
|
||
## 错误码
|
||
- `401` 未带/无效/过期 admin token、管理员被禁用(响应头带 `WWW-Authenticate: Bearer`)
|
||
- `422` query 参数校验失败(如 `limit` 越界、类型错误)
|
||
|
||
## 说明
|
||
关联 [coin_transaction](../database/coin_transaction.md)。金币为个数计量,非分。
|