a563c1ca4b
docs/api目录文档分类和补全 --------- Co-authored-by: guke <guke@autohome.com.cn> Reviewed-on: #111
1.7 KiB
1.7 KiB
GET /admin/api/wallet/cash-transactions — 现金流水(游标分页)
所属:Admin·钱包 组(前缀
/admin/api/wallet) | 鉴权:Bearer admin_token(角色:任意已登录管理员,仅需get_current_admin,无require_role) | ← 返回 API 索引
跨用户查询全量现金流水,可按 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: CashTxnOut[], next_cursor: int|null }(next_cursor=null 表示末页)
CashTxnOut
| 字段 | 类型 | 说明 |
|---|---|---|
id |
int | 流水主键 |
user_id |
int | 所属用户 |
amount_cents |
int | 现金变动量,单位:分(正/负) |
balance_after_cents |
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)422query 参数校验失败(如limit越界、类型错误)
说明
关联 cash_transaction。所有金额字段单位为分。