swagger docs update
This commit is contained in:
parent
28da81ea59
commit
51ee003b24
3 changed files with 309 additions and 0 deletions
118
docs/docs.go
118
docs/docs.go
|
|
@ -181,6 +181,113 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/login": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Логин",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Users - auth"
|
||||
],
|
||||
"summary": "Логин",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "логин",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/user.Login"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/logout": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Логаут. Uuid юзера будет извлечен из токена.",
|
||||
"tags": [
|
||||
"Users - auth"
|
||||
],
|
||||
"summary": "Логаут",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/refresh": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Принимает рефреш токен в заголовке Authorization",
|
||||
"tags": [
|
||||
"Users - auth"
|
||||
],
|
||||
"summary": "Обновление аксесс токена по рефреш токену.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
|
|
@ -225,6 +332,17 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"user.Login": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user.Register": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
|||
|
|
@ -173,6 +173,113 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/login": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Логин",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Users - auth"
|
||||
],
|
||||
"summary": "Логин",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "логин",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/user.Login"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/logout": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Логаут. Uuid юзера будет извлечен из токена.",
|
||||
"tags": [
|
||||
"Users - auth"
|
||||
],
|
||||
"summary": "Логаут",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/refresh": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Принимает рефреш токен в заголовке Authorization",
|
||||
"tags": [
|
||||
"Users - auth"
|
||||
],
|
||||
"summary": "Обновление аксесс токена по рефреш токену.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
|
|
@ -217,6 +324,17 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"user.Login": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user.Register": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,13 @@ definitions:
|
|||
username:
|
||||
type: string
|
||||
type: object
|
||||
user.Login:
|
||||
properties:
|
||||
email:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
type: object
|
||||
user.Register:
|
||||
properties:
|
||||
email:
|
||||
|
|
@ -153,6 +160,72 @@ paths:
|
|||
summary: Обновить информацию о пользователе
|
||||
tags:
|
||||
- Users
|
||||
/user/login:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Логин
|
||||
parameters:
|
||||
- description: логин
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/user.Login'
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/responses.ErrorResponse400'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/responses.ErrorResponse500'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Логин
|
||||
tags:
|
||||
- Users - auth
|
||||
/user/logout:
|
||||
post:
|
||||
description: Логаут. Uuid юзера будет извлечен из токена.
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/responses.ErrorResponse400'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/responses.ErrorResponse500'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Логаут
|
||||
tags:
|
||||
- Users - auth
|
||||
/user/refresh:
|
||||
post:
|
||||
description: Принимает рефреш токен в заголовке Authorization
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/responses.ErrorResponse400'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/responses.ErrorResponse500'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Обновление аксесс токена по рефреш токену.
|
||||
tags:
|
||||
- Users - auth
|
||||
securityDefinitions:
|
||||
BearerAuth:
|
||||
description: Введите "Bearer {your_token}" для аутентификации
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue