{"openapi":"3.0.3","info":{"title":"随机用户信息","description":"随机生成头像、网名与座右铭。\n### 平台统一约定\n- **响应信封**：`output=json`（默认）返回 `{code, msg, data}`，code 与 HTTP 状态码一致；`output=raw` 直接返回简单文本或图片二进制\n- **鉴权**：公开接口无需凭据；需鉴权接口携带 `X-App-Id` + `X-App-Secret`（明文）或 `X-App-Id` + `X-Timestamp` + `X-Nonce` + `X-Signature`（HMAC-SHA256 签名），文档页右上角「鉴权助手」可在线生成请求头\n- **默认限流**：60 次/秒（粒度 {appid|ip}:{plugin}，appid 级配额可覆盖；超限返回 429）\n- **文档数据**：接口参数/返回/示例来自 handler 方法 PHPDoc 注解，方法注册/鉴权/限流来自 manifest","version":"1.0.0"},"servers":[{"url":"/api/random-user","description":"当前站点"}],"tags":[{"name":"公开接口","description":"无需凭据即可调用"},{"name":"需鉴权接口","description":"需携带 appid/appsecret（明文双头或 HMAC 签名），详见「鉴权助手」"}],"paths":{"/user":{"get":{"tags":["公开接口"],"summary":"随机生成头像/网名/座右铭组合","description":"**返回**：data 为 {avatar(图片URL), name, motto}\n\n**默认限流**：60 次/秒（appid 级配额可覆盖）","operationId":"random-user_user","x-auth-required":false,"x-rate-limit":{"s":60},"parameters":[{"name":"avatarType","in":"query","required":false,"description":"头像类型：boy（男生）|girl（女生）|comic-all（动漫）|comic-boy（动漫男）|comic-girl（动漫女），留空随机全部","schema":{"type":"string"}},{"name":"nameType","in":"query","required":false,"description":"网名字数：2~6（对应字数）|7（长网名），留空随机全部","schema":{"type":"integer"}},{"name":"output","in":"query","required":false,"description":"json（默认，统一信封）|raw（输出「name motto」文本）","schema":{"type":"string"}}],"responses":{"200":{"description":"成功。raw 输出示例：`{\"code\":200,\"msg\":\"\",\"data\":{\"\"avatar\":\"https://example.com/api/random-user/data/avatar/boy/xxx.jpg\",\"name\":\"清风徐来\",\"motto\":\"慢慢来，比较快\"}}`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/avatar":{"get":{"tags":["公开接口"],"summary":"随机头像","description":"**返回**：data 为 {avatar(图片URL)}；raw 模式直接输出图片二进制\n\n**默认限流**：60 次/秒（appid 级配额可覆盖）","operationId":"random-user_avatar","x-auth-required":false,"x-rate-limit":{"s":60},"parameters":[{"name":"type","in":"query","required":false,"description":"头像类型：boy（男生）|girl（女生）|comic-all（动漫）|comic-boy（动漫男）|comic-girl（动漫女），留空随机全部","schema":{"type":"string"}},{"name":"output","in":"query","required":false,"description":"json（默认，统一信封）|raw（直接输出图片二进制 image/jpeg）","schema":{"type":"string"}}],"responses":{"200":{"description":"成功（output=raw 时直接返回图片二进制 image/jpeg）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"},"example":{"code":200,"msg":"","data":{"avatar":"https://example.com/api/random-user/data/avatar/boy/xxx.jpg"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/name":{"get":{"tags":["公开接口"],"summary":"随机网名","description":"**返回**：data 为 {name}；raw 模式直接输出网名文本\n\n**默认限流**：60 次/秒（appid 级配额可覆盖）","operationId":"random-user_name","x-auth-required":false,"x-rate-limit":{"s":60},"parameters":[{"name":"type","in":"query","required":false,"description":"网名字数：2~6（对应字数）|7（长网名），留空随机全部","schema":{"type":"integer"}},{"name":"output","in":"query","required":false,"description":"json（默认，统一信封）|raw（输出纯文本）","schema":{"type":"string"}}],"responses":{"200":{"description":"成功（output=raw 时返回纯文本）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"},"example":{"code":200,"msg":"","data":{"name":"清风徐来"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/motto":{"get":{"tags":["公开接口"],"summary":"随机座右铭","description":"**返回**：data 为 {motto}；raw 模式直接输出座右铭文本\n\n**默认限流**：60 次/秒（appid 级配额可覆盖）","operationId":"random-user_motto","x-auth-required":false,"x-rate-limit":{"s":60},"parameters":[{"name":"output","in":"query","required":false,"description":"json（默认，统一信封）|raw（输出纯文本）","schema":{"type":"string"}}],"responses":{"200":{"description":"成功（output=raw 时返回纯文本）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"},"example":{"code":200,"msg":"","data":{"motto":"慢慢来，比较快"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"Envelope":{"type":"object","description":"平台统一响应信封，code 与 HTTP 状态码一致；output=raw 时无信封（直接输出文本/图片二进制）","properties":{"code":{"type":"integer","description":"200 成功；400 参数错误；401 凭据无效；403 拒绝访问；429 触发限流；500 服务异常"},"msg":{"type":"string","description":"提示信息"},"data":{"type":"object","description":"业务数据（结构见各接口说明）"}}}},"securitySchemes":{"plainAppId":{"type":"apiKey","in":"header","name":"X-App-Id","description":"明文方式：appid"},"plainSecret":{"type":"apiKey","in":"header","name":"X-App-Secret","description":"明文方式：appsecret（HTTPS 下使用）"},"hmacAppId":{"type":"apiKey","in":"header","name":"X-App-Id","description":"HMAC 方式：appid"},"hmacTimestamp":{"type":"apiKey","in":"header","name":"X-Timestamp","description":"HMAC 方式：秒级时间戳（±300s 时间窗）"},"hmacNonce":{"type":"apiKey","in":"header","name":"X-Nonce","description":"HMAC 方式：一次性随机串（5 分钟内不可重复）"},"hmacSignature":{"type":"apiKey","in":"header","name":"X-Signature","description":"HMAC 方式：base64(HMAC-SHA256(secret, 签名串))，签名串见「鉴权助手」"}},"responses":{"BadRequest":{"description":"参数错误（缺少必填/格式非法）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"Unauthorized":{"description":"凭据缺失或无效（appid 不存在/停用/未授权该插件/签名错误）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"Forbidden":{"description":"拒绝访问（IP/UA 名单命中）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"RateLimited":{"description":"触发限流（X-RateLimit-Remaining: 0，Retry-After 头提示等待秒数）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"ServerError":{"description":"服务端异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}},"x-plugin":{"slug":"random-user","name":"随机用户信息","description":"随机生成头像、网名与座右铭。","version":"1.0.0","methodCount":4,"authMethods":[],"rateLimit":{"s":60},"warnings":[]}}