0e42e96ddb
新增 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>
1.8 KiB
1.8 KiB
GET /admin/api/users — 用户列表(筛选+分页)
所属:Admin·用户 组(前缀
/admin/api/users) | 鉴权:Bearer admin_token(角色:任意已登录管理员,无 require_role) | ← 返回 API 索引
入参(query)
| 字段 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
phone |
string | ❌ | null | 手机号前缀匹配(phone LIKE '<值>%') |
register_channel |
string | ❌ | null | 注册渠道,精确匹配 |
status |
string | ❌ | null | 用户状态,精确匹配:active / disabled / deleted |
limit |
int | ❌ | 20 | 1–100 |
cursor |
int | ❌ | null | 上一页 next_cursor(按 user id 倒序,查 id < cursor) |
出参
响应 200:{ items: AdminUserListItem[], next_cursor: int|null }(next_cursor=null 表示末页)
AdminUserListItem
| 字段 | 类型 | 说明 |
|---|---|---|
id |
int | 用户 id |
phone |
string | 手机号 |
nickname |
string | null | 昵称,可空 |
register_channel |
string | 注册渠道 |
status |
string | 用户状态:active / disabled / deleted |
wechat_openid |
string | null | 微信 openid,可空 |
created_at |
datetime | 注册时间(UTC) |
last_login_at |
datetime | 上次登录时间(UTC) |
错误码
401未带/无效/过期 admin token、管理员被禁用(头带WWW-Authenticate: Bearer)422limit超出 1–100 范围 / 字段类型不合法
说明
- 游标分页约定:结果按 user
id倒序;cursor传上一页返回的next_cursor;next_cursor=null即末页。 phone为前缀匹配(LIKE '<值>%'),register_channel/status为精确匹配;三者可叠加。- 关联用户表 user。
- 历史明细(金币流水、提现、比价、反馈等)不在本列表,走各自带
user_id过滤的分页接口。