/admin/users
获取租户下的用户列表,支持按状态和关键字搜索
Request Parameters
| Name | In | Type | Required | Default | Example | Constraints | Description |
|---|---|---|---|---|---|---|---|
status |
query |
string |
No | 用户状态 | |||
search |
query |
string |
No | 搜索关键字 | |||
is_minor |
query |
boolean |
No | 是否未成年人筛选 | |||
page |
query |
integer |
No | 1 |
页码 | ||
limit |
query |
integer |
No | 20 |
每页数量 |
Responses
| Status | Description | Schema |
|---|---|---|
| 200 | 用户列表 | dto.UserListResponse |
| 401 | 未认证或令牌无效 | dto.Problem |
| 403 | 权限不足 | dto.Problem |
| 404 | 资源不存在 | dto.Problem |
| 500 | 服务器内部错误 | dto.Problem |
Referenced Schemas
dto.AuthUserResponse
认证用户信息
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
age_group |
string |
No | 年龄分组 | ||
birth_date |
string |
No | 出生日期 (RFC3339) | ||
created_at |
string |
No | 2026-01-01T00:00:00Z |
创建时间 | |
email |
string |
No | john@example.com |
邮箱 | |
email_verified_at |
string |
No | 2026-01-10T08:00:00Z |
邮箱验证时间 | |
id |
string |
No | usr_abc123 |
用户ID | |
is_minor |
boolean |
No | 是否未成年人 | ||
last_login_at |
string |
No | 2026-04-14T10:30:00Z |
最后登录 | |
last_login_ip |
string |
No | 192.168.1.1 |
最后登录IP | |
locked_until |
string |
No | 2026-04-15T12:00:00Z |
锁定截止 | |
login_fail_count |
integer |
No | 0 |
失败次数 | |
metadata |
object |
No | 扩展元数据 | ||
mfa_enabled |
boolean |
No | False |
是否启用MFA | |
mfa_type |
string |
No | totp |
MFA类型 | |
must_change_password |
boolean |
No | False |
需要强制修改密码 | |
password_changed_at |
string |
No | 密码最后修改时间 | ||
pending_parental_consent |
boolean |
No | 是否等待家长同意 | ||
phone |
string |
No | 13800138000 |
手机号 | |
phone_verified_at |
string |
No | 2026-01-10T08:00:00Z |
手机验证时间 | |
status |
string |
No | active |
状态 | |
tenant_id |
string |
No | tnt_xyz789 |
租户ID | |
updated_at |
string |
No | 2026-04-10T14:20:00Z |
更新时间 | |
username |
string |
No | john_doe |
用户名 |
dto.FieldViolation
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
string |
No | Code 是错误代码(可选) 用于程序识别错误类型,如 "required", "format", "range" | ||
description |
string |
No | Description 是人类可读的错误描述 应该说明违反了什么规则,如 "必须是一个有效的邮箱地址" | ||
field |
string |
No | Field 是错误字段的路径 使用点号表示嵌套字段,如 "user.email" 或 "addresses[0].city" | ||
value |
object |
No | Value 是导致错误的值(可选,开发模式下使用) 生产环境可能不返回此字段以避免泄露敏感信息 |
dto.Problem
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | Code 是业务错误码 用于程序处理特定错误场景 示例:30101001 | ||
detail |
string |
No | Detail 是针对此具体错误实例的人类可读解释 可以包含具体的错误细节,如"Field 'email' is required" | ||
errors |
array of |
No | Errors 是字段级验证错误列表(扩展字段) 遵循 Web API 标准实践,每个错误包含字段名和错误信息 | ||
i18n_args |
object |
No | I18nArgs 是国际化参数 用于动态填充翻译模板 | ||
i18n_key |
string |
No | I18nKey 是国际化键 用于客户端本地化错误消息 示例:"error.user_not_found" | ||
instance |
string |
No | Instance 是发生问题的具体URI引用 通常是请求的URL,可能包含查询参数 示例:"/api/v1/users?limit=invalid" | ||
request_id |
string |
No | RequestID 是请求唯一标识 用于日志关联和问题追踪 示例:"req_550e8400-e29b-41d4-a716-446655440000" | ||
retry_after |
integer |
No | RetryAfter 用于 429 Too Many Requests 响应 指示客户端应在多少秒后重试请求(RFC 6585) | ||
service |
string |
No | Service 是服务名 用于微服务架构中定位错误来源 示例:"auth-service" | ||
span_id |
string |
No | SpanID 是当前 span 标识 用于精确定位分布式链路中的当前节点 | ||
status |
integer |
No | Status 是产生的HTTP状态码 用于客户端区分问题类型,不随Accept-Language变化 示例:400, 401, 403, 404, 500 | ||
timestamp |
string |
No | Timestamp 是错误发生时间 ISO 8601 格式 示例:"2026-04-03T12:00:00Z" | ||
title |
string |
No | Title 是简短、人类可读的问题类型摘要 相同的 Type 应该始终有相同的 Title(不随实例变化) 示例:"Invalid Request Parameters" | ||
trace_id |
string |
No | TraceID 是分布式追踪标识 遵循 W3C Trace Context 标准 示例:"00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01" | ||
type |
string |
No | Type 是标识问题类型的URI引用 当该URI被解引用时,应提供人类可读的文档 示例:"https://api.example.com/errors/invalid-request" |
dto.UserListResponse
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | |||
items |
array of |
No | 统一使用 items | ||
message |
string |
No | |||
pagination |
object |
No | 分页信息(嵌套对象) | ||
timestamp |
string |
No | |||
total |
integer |
No | 总条数(平铺,便于直接读取) |
gitee_com_linmes_authms_base_dto.PageInfo
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
has_next |
boolean |
No | HasNext indicates whether there is a next page | ||
has_prev |
boolean |
No | HasPrev indicates whether there is a previous page | ||
page |
integer |
No | Page is the current page number (1-based) | ||
page_size |
integer |
No | PageSize is the number of items per page | ||
total |
integer |
No | Total is the total number of items across all pages | ||
total_pages |
integer |
No | TotalPages is the total number of pages |