swagger docs update

This commit is contained in:
nquidox 2025-07-07 17:49:34 +03:00
parent 28da81ea59
commit 51ee003b24
3 changed files with 309 additions and 0 deletions

View file

@ -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": { "definitions": {
@ -225,6 +332,17 @@ const docTemplate = `{
} }
} }
}, },
"user.Login": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"user.Register": { "user.Register": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -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": { "definitions": {
@ -217,6 +324,17 @@
} }
} }
}, },
"user.Login": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"user.Register": { "user.Register": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -27,6 +27,13 @@ definitions:
username: username:
type: string type: string
type: object type: object
user.Login:
properties:
email:
type: string
password:
type: string
type: object
user.Register: user.Register:
properties: properties:
email: email:
@ -153,6 +160,72 @@ paths:
summary: Обновить информацию о пользователе summary: Обновить информацию о пользователе
tags: tags:
- Users - 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: securityDefinitions:
BearerAuth: BearerAuth:
description: Введите "Bearer {your_token}" для аутентификации description: Введите "Bearer {your_token}" для аутентификации