2025-07-06 22:29:48 +03:00
|
|
|
|
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
|
|
|
|
|
package docs
|
|
|
|
|
|
|
|
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
|
|
|
|
|
|
|
|
const docTemplate = `{
|
|
|
|
|
|
"schemes": {{ marshal .Schemes }},
|
|
|
|
|
|
"swagger": "2.0",
|
|
|
|
|
|
"info": {
|
|
|
|
|
|
"description": "{{escape .Description}}",
|
|
|
|
|
|
"title": "{{.Title}}",
|
|
|
|
|
|
"contact": {},
|
|
|
|
|
|
"version": "{{.Version}}"
|
|
|
|
|
|
},
|
|
|
|
|
|
"host": "{{.Host}}",
|
|
|
|
|
|
"basePath": "{{.BasePath}}",
|
|
|
|
|
|
"paths": {
|
|
|
|
|
|
"/user": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"description": "Получает информацию о пользователе по его uuid из токена",
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"Users"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "Получить информацию о пользователе",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/user.Info"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "Bad Request",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse400"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "Unauthorized",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse401"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"500": {
|
|
|
|
|
|
"description": "Internal Server Error",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse500"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"put": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"description": "Обновить информацию о пользователе по его uuid из токена",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"Users"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "Обновить информацию о пользователе",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "изменения",
|
|
|
|
|
|
"name": "body",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/user.Update"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK"
|
|
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "Bad Request",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse400"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "Unauthorized",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse401"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"500": {
|
|
|
|
|
|
"description": "Internal Server Error",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse500"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"description": "Регистрация нового пользователя",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"Users"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "Регистрация нового пользователя",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "новый пользователь",
|
|
|
|
|
|
"name": "body",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/user.Register"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK"
|
|
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "Bad Request",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse400"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"500": {
|
|
|
|
|
|
"description": "Internal Server Error",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse500"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"delete": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"description": "Помечает пользователя как удаленного по его uuid из токена",
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"Users"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "Удалить пользователя",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK"
|
|
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "Bad Request",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse400"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "Unauthorized",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse401"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"500": {
|
|
|
|
|
|
"description": "Internal Server Error",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse500"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-07 17:49:34 +03:00
|
|
|
|
},
|
2025-09-14 19:34:06 +03:00
|
|
|
|
"/user/auth/current-session": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"description": "Возвращает информацию о текущей сессии пользователя",
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"Users"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "Возвращает информацию о текущей сессии пользователя",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/shared.CurrentSession"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "Bad Request",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse400"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "Unauthorized",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse401"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"500": {
|
|
|
|
|
|
"description": "Internal Server Error",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse500"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-12 23:54:56 +03:00
|
|
|
|
"/user/auth/login": {
|
2025-07-07 17:49:34 +03:00
|
|
|
|
"post": {
|
|
|
|
|
|
"description": "Логин",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"Users - auth"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "Логин",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "логин",
|
|
|
|
|
|
"name": "body",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/user.Login"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-12 23:54:56 +03:00
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/user.LoginResponse"
|
|
|
|
|
|
}
|
2025-07-07 17:49:34 +03:00
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "Bad Request",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse400"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"500": {
|
|
|
|
|
|
"description": "Internal Server Error",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse500"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-12 23:54:56 +03:00
|
|
|
|
"/user/auth/logout": {
|
2025-07-07 17:49:34 +03:00
|
|
|
|
"post": {
|
2025-09-12 23:54:56 +03:00
|
|
|
|
"description": "Логаут. Для логаута надо передать refresh token, он будет инвалидирован.",
|
2025-07-07 17:49:34 +03:00
|
|
|
|
"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"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-12 23:54:56 +03:00
|
|
|
|
"/user/auth/refresh": {
|
2025-07-07 17:49:34 +03:00
|
|
|
|
"post": {
|
2025-09-14 16:23:01 +03:00
|
|
|
|
"description": "Принимает рефреш токен в http only куки",
|
2025-07-07 17:49:34 +03:00
|
|
|
|
"tags": [
|
|
|
|
|
|
"Users - auth"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "Обновление аксесс токена по рефреш токену.",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
2025-09-12 23:54:56 +03:00
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/user.LoginResponse"
|
|
|
|
|
|
}
|
2025-07-07 17:49:34 +03:00
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "Bad Request",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse400"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"500": {
|
|
|
|
|
|
"description": "Internal Server Error",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/responses.ErrorResponse500"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-06 22:29:48 +03:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"definitions": {
|
|
|
|
|
|
"responses.ErrorResponse400": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"error": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "Bad Request"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"responses.ErrorResponse401": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"error": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "Unauthorized"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"responses.ErrorResponse500": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"error": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"example": "Internal Server Error"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-14 19:34:06 +03:00
|
|
|
|
"shared.CurrentSession": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"expires": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"uuid": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-07-06 22:29:48 +03:00
|
|
|
|
"user.Info": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"created_at": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"email": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"username": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-07-07 17:49:34 +03:00
|
|
|
|
"user.Login": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"email": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"password": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-09-12 23:54:56 +03:00
|
|
|
|
"user.LoginResponse": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"access_token": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-07-06 22:29:48 +03:00
|
|
|
|
"user.Register": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"email": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"password": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"username": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"user.Update": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"email": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"username": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"securityDefinitions": {
|
|
|
|
|
|
"BearerAuth": {
|
|
|
|
|
|
"description": "Введите \"Bearer {your_token}\" для аутентификации",
|
|
|
|
|
|
"type": "apiKey",
|
|
|
|
|
|
"name": "Authorization",
|
|
|
|
|
|
"in": "header"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}`
|
|
|
|
|
|
|
|
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
|
|
|
var SwaggerInfo = &swag.Spec{
|
|
|
|
|
|
Version: "2.0.0-alpha",
|
|
|
|
|
|
Host: "",
|
|
|
|
|
|
BasePath: "/api/v2",
|
|
|
|
|
|
Schemes: []string{},
|
|
|
|
|
|
Title: "Merch Parser",
|
|
|
|
|
|
Description: "",
|
|
|
|
|
|
InfoInstanceName: "swagger",
|
|
|
|
|
|
SwaggerTemplate: docTemplate,
|
|
|
|
|
|
LeftDelim: "{{",
|
|
|
|
|
|
RightDelim: "}}",
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
|
|
|
|
}
|