You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
376 lines
8.5 KiB
JSON
376 lines
8.5 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "用户中心API",
|
|
"description": "用户中心API定义",
|
|
"version": "v1"
|
|
},
|
|
"host": "127.0.0.1",
|
|
"schemes": [
|
|
"http",
|
|
"https"
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"paths": {
|
|
"api/user/bind/{platform}": {
|
|
"post": {
|
|
"summary": "绑定社交账号",
|
|
"operationId": "bindSocial",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "platform",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"description": " BindSocialReq 普通用户绑定社交账号请求",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/BindSocialReq"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {},
|
|
"tags": [
|
|
"user/admin"
|
|
]
|
|
}
|
|
},
|
|
"api/user/login": {
|
|
"post": {
|
|
"summary": "登录",
|
|
"operationId": "login",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/LoginResp"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"description": " LoginReq 登录请求,登录主体/验证方式 后期将由专门服务进行管理,不再传递",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/LoginReq"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {},
|
|
"tags": [
|
|
"user"
|
|
]
|
|
}
|
|
},
|
|
"api/user/register": {
|
|
"post": {
|
|
"summary": "用户注册",
|
|
"operationId": "register",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/RegisterResp"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"description": " RegisterReq 用户注册请求",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/RegisterReq"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {},
|
|
"tags": [
|
|
"user"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"BindSocialReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"platform": {
|
|
"type": "string",
|
|
"description": " 平台类型 wechat | qq | weibo"
|
|
},
|
|
"code": {
|
|
"type": "string",
|
|
"description": " 第三方平台code"
|
|
}
|
|
},
|
|
"title": "BindSocialReq",
|
|
"required": [
|
|
"platform",
|
|
"code"
|
|
]
|
|
},
|
|
"JwtToken": {
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"expire": {
|
|
"type": "string"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"title": "JwtToken",
|
|
"required": [
|
|
"access_token",
|
|
"expire",
|
|
"refresh_token"
|
|
]
|
|
},
|
|
"LoginReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subjectType": {
|
|
"type": "string",
|
|
"description": " 登录主体"
|
|
},
|
|
"validationType": {
|
|
"type": "string",
|
|
"default": "password",
|
|
"description": " 验证方式"
|
|
},
|
|
"username": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 用户名"
|
|
},
|
|
"phoneNumber": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 手机号码"
|
|
},
|
|
"email": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 邮箱"
|
|
},
|
|
"platform": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 社交平台"
|
|
},
|
|
"password": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 密码"
|
|
},
|
|
"validationCode": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 验证码"
|
|
},
|
|
"code": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 第三方平台code"
|
|
}
|
|
},
|
|
"title": "LoginReq",
|
|
"required": [
|
|
"subjectType",
|
|
"validationType"
|
|
]
|
|
},
|
|
"LoginResp": {
|
|
"type": "object",
|
|
"properties": {
|
|
"": {
|
|
"$ref": "#/definitions/JwtToken"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"title": "LoginResp",
|
|
"required": [
|
|
"id"
|
|
]
|
|
},
|
|
"RegisterReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"validationType": {
|
|
"type": "string",
|
|
"default": "password",
|
|
"description": " 验证方式"
|
|
},
|
|
"username": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 用户名"
|
|
},
|
|
"phoneNumber": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 手机号码"
|
|
},
|
|
"email": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 邮箱"
|
|
},
|
|
"platform": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 社交平台"
|
|
},
|
|
"password": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 密码"
|
|
},
|
|
"validationCode": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 验证码"
|
|
},
|
|
"code": {
|
|
"$ref": "#/definitions/string",
|
|
"description": " 第三方平台code"
|
|
}
|
|
},
|
|
"title": "RegisterReq",
|
|
"required": [
|
|
"validationType"
|
|
]
|
|
},
|
|
"RegisterResp": {
|
|
"type": "object",
|
|
"properties": {
|
|
"": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
},
|
|
"title": "RegisterResp"
|
|
},
|
|
"Role": {
|
|
"type": "object",
|
|
"title": "Role"
|
|
},
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": " ID"
|
|
},
|
|
"username": {
|
|
"type": "string",
|
|
"description": " 用户名"
|
|
},
|
|
"phoneNumber": {
|
|
"type": "string",
|
|
"description": " 手机号码"
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"description": " 邮箱"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": " 密码"
|
|
},
|
|
"status": {
|
|
"$ref": "#/definitions/uint8",
|
|
"description": " 用户状态"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": " 姓名"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": " 昵称"
|
|
},
|
|
"gender": {
|
|
"$ref": "#/definitions/uint8",
|
|
"description": " 性别"
|
|
},
|
|
"birthdate": {
|
|
"type": "string",
|
|
"description": " 生日"
|
|
},
|
|
"address": {
|
|
"type": "string",
|
|
"description": " 地址"
|
|
},
|
|
"age": {
|
|
"$ref": "#/definitions/uint8",
|
|
"description": " 年龄"
|
|
},
|
|
"country": {
|
|
"type": "string",
|
|
"description": " 国家"
|
|
},
|
|
"picture": {
|
|
"type": "string",
|
|
"description": " 头像地址"
|
|
},
|
|
"string": {
|
|
"$ref": "#/definitions/mapstringinterface",
|
|
"description": " 用户社交属性"
|
|
},
|
|
"createTime": {
|
|
"type": "string",
|
|
"description": " 创建时间"
|
|
},
|
|
"updateTime": {
|
|
"type": "string",
|
|
"description": " 更新时间"
|
|
}
|
|
},
|
|
"title": "User",
|
|
"required": [
|
|
"id",
|
|
"username",
|
|
"phoneNumber",
|
|
"email",
|
|
"password",
|
|
"status",
|
|
"name",
|
|
"nickname",
|
|
"gender",
|
|
"birthdate",
|
|
"address",
|
|
"age",
|
|
"country",
|
|
"picture",
|
|
"string",
|
|
"createTime",
|
|
"updateTime"
|
|
]
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"apiKey": {
|
|
"type": "apiKey",
|
|
"description": "Enter JWT Bearer token **_only_**",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"apiKey": []
|
|
}
|
|
]
|
|
}
|