POST /admin/users/{user_id}/identities

为指定用户添加新的登录身份(如邮箱、手机号、第三方账号)

身份认证 `bearerAuth` application/json

请求参数

名称位置类型必填默认值示例约束描述
user_id path string 是 用户ID

请求体

Schema: service-identity/internal/handler/dto.AddIdentityRequest

字段类型必填示例约束描述
identifier string 是 标识
type string 是 enum: `email`, `phone` 类型
code string 否 验证码
password string 否 密码

响应

引用的 Schema

service-identity/internal/handler/dto.AddIdentityResponse

字段类型必填示例约束描述
code integer 否
data service-identity/internal/handler/dto.IdentityResponse 否
message string 否
timestamp string 否

service-identity/internal/handler/dto.IdentityResponse

用户身份凭证信息

字段类型必填示例约束描述
created_at string 否 2026-01-01T00:00:00Z 创建时间
id string 否 id_abc123 凭证ID
identifier string 否 j***@example.com 标识(脱敏)
is_primary boolean 否 True 是否主凭证
is_verified boolean 否 True 是否验证
type string 否 email 类型
user_id string 否 usr_abc123 用户ID
verified_at string 否 2026-01-10T08:00:00Z 验证时间