227 lines
4.5 KiB
JSON
Raw Normal View History

2021-05-13 22:03:40 +08:00
{
"swagger": "2.0",
"info": {
"title": "type title here",
"description": "type desc here",
"version": "type version here"
},
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
2021-08-20 12:18:32 +08:00
"/api/user/login": {
"post": {
"summary": "登录",
"operationId": "login",
"responses": {
"200": {
"description": "A successful response.",
"schema": {}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/LoginReq"
}
}
],
"tags": [
"user-api"
]
}
},
2021-05-13 22:03:40 +08:00
"/api/user/register": {
"post": {
"summary": "注册",
"operationId": "register",
"responses": {
"200": {
"description": "A successful response.",
"schema": {}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/RegisterReq"
}
}
],
"tags": [
"user-api"
]
}
2021-08-20 12:18:32 +08:00
},
"/api/user/search": {
"get": {
"summary": "用户搜索",
"operationId": "searchUser",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/UserInfoReply"
}
}
},
"parameters": [
{
"name": "keyWord",
"description": " 关键词",
"in": "query",
"required": true,
"type": "string"
}
],
"tags": [
"user-api"
]
}
},
"/api/user/{id}": {
"get": {
"summary": "获取用户信息",
"operationId": "getUserInfo",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/UserInfoReply"
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"user-api"
]
}
2021-05-13 22:03:40 +08:00
}
},
"definitions": {
2021-08-20 12:18:32 +08:00
"LoginReq": {
"type": "object",
"properties": {
"username": {
"type": "string",
"description": "测试"
},
"password": {
"type": "string",
"description": "测试2"
}
},
"title": "LoginReq",
"required": [
"username",
"password"
]
},
2021-05-13 22:03:40 +08:00
"RegisterReq": {
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
},
"mobile": {
"type": "string"
}
},
"title": "RegisterReq",
"required": [
"username",
"password",
"mobile"
]
2021-08-20 12:18:32 +08:00
},
"UserInfoReply": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "integer",
"format": "int32"
},
"birthday": {
"type": "string"
},
"description": {
"type": "string"
},
"tag": {
"type": "array",
"items": {
"type": "string"
}
}
},
"title": "UserInfoReply",
"required": [
"name",
"age",
"birthday",
"description",
"tag"
]
},
"UserInfoReq": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"title": "UserInfoReq",
"required": [
"id"
]
},
"UserSearchReq": {
"type": "object",
"properties": {
"keyWord": {
"type": "string",
"description": " 关键词"
}
},
"title": "UserSearchReq",
"required": [
"keyWord"
]
2021-05-13 22:03:40 +08:00
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
}