swagger docs update
This commit is contained in:
parent
06d952c145
commit
f07131264f
3 changed files with 53 additions and 40 deletions
36
docs/docs.go
36
docs/docs.go
|
|
@ -104,11 +104,6 @@ const docTemplate = `{
|
|||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Регистрация нового пользователя",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
|
|
@ -182,13 +177,8 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/login": {
|
||||
"/user/auth/login": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Логин",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
|
|
@ -210,7 +200,10 @@ const docTemplate = `{
|
|||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/user.LoginResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
|
|
@ -227,14 +220,14 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/logout": {
|
||||
"/user/auth/logout": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Логаут. Uuid юзера будет извлечен из токена.",
|
||||
"description": "Логаут. Для логаута надо передать refresh token, он будет инвалидирован.",
|
||||
"tags": [
|
||||
"Users - auth"
|
||||
],
|
||||
|
|
@ -258,7 +251,7 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/refresh": {
|
||||
"/user/auth/refresh": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
|
|
@ -272,7 +265,10 @@ const docTemplate = `{
|
|||
"summary": "Обновление аксесс токена по рефреш токену.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/user.LoginResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
|
|
@ -343,6 +339,14 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"user.LoginResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"access_token": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user.Register": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
|||
|
|
@ -96,11 +96,6 @@
|
|||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Регистрация нового пользователя",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
|
|
@ -174,13 +169,8 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/login": {
|
||||
"/user/auth/login": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Логин",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
|
|
@ -202,7 +192,10 @@
|
|||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/user.LoginResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
|
|
@ -219,14 +212,14 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/logout": {
|
||||
"/user/auth/logout": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Логаут. Uuid юзера будет извлечен из токена.",
|
||||
"description": "Логаут. Для логаута надо передать refresh token, он будет инвалидирован.",
|
||||
"tags": [
|
||||
"Users - auth"
|
||||
],
|
||||
|
|
@ -250,7 +243,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/refresh": {
|
||||
"/user/auth/refresh": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
|
|
@ -264,7 +257,10 @@
|
|||
"summary": "Обновление аксесс токена по рефреш токену.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/user.LoginResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
|
|
@ -335,6 +331,14 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"user.LoginResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"access_token": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user.Register": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@ definitions:
|
|||
password:
|
||||
type: string
|
||||
type: object
|
||||
user.LoginResponse:
|
||||
properties:
|
||||
access_token:
|
||||
type: string
|
||||
type: object
|
||||
user.Register:
|
||||
properties:
|
||||
email:
|
||||
|
|
@ -124,8 +129,6 @@ paths:
|
|||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/responses.ErrorResponse500'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Регистрация нового пользователя
|
||||
tags:
|
||||
- Users
|
||||
|
|
@ -160,7 +163,7 @@ paths:
|
|||
summary: Обновить информацию о пользователе
|
||||
tags:
|
||||
- Users
|
||||
/user/login:
|
||||
/user/auth/login:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
|
|
@ -175,6 +178,8 @@ paths:
|
|||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/user.LoginResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
|
|
@ -183,14 +188,12 @@ paths:
|
|||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/responses.ErrorResponse500'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Логин
|
||||
tags:
|
||||
- Users - auth
|
||||
/user/logout:
|
||||
/user/auth/logout:
|
||||
post:
|
||||
description: Логаут. Uuid юзера будет извлечен из токена.
|
||||
description: Логаут. Для логаута надо передать refresh token, он будет инвалидирован.
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
|
|
@ -207,12 +210,14 @@ paths:
|
|||
summary: Логаут
|
||||
tags:
|
||||
- Users - auth
|
||||
/user/refresh:
|
||||
/user/auth/refresh:
|
||||
post:
|
||||
description: Принимает рефреш токен в заголовке Authorization
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/user.LoginResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue