1500 lines
50 KiB
Go
1500 lines
50 KiB
Go
// 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": {
|
||
"/merch": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Добавить новый мерч",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch"
|
||
],
|
||
"summary": "Добавить новый мерч",
|
||
"parameters": [
|
||
{
|
||
"description": "новый мерч",
|
||
"name": "body",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.MerchDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/merch/": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Получить все записи мерча",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch"
|
||
],
|
||
"summary": "Получить все записи мерча",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/merch.ListResponse"
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Обновить информацию про мерч по его uuid в json-е",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch"
|
||
],
|
||
"summary": "Обновить информацию про мерч",
|
||
"parameters": [
|
||
{
|
||
"description": "merch_uuid",
|
||
"name": "body",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.UpdateMerchDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/merch/images/{uuid}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Получить картинки по merch_uuid и query параметрам",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch images"
|
||
],
|
||
"summary": "Получить картинки по merch_uuid и query параметрам",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "merch_uuid",
|
||
"name": "uuid",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "image type",
|
||
"name": "type",
|
||
"in": "query",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.ImageLink"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Загрузить картинку по merch_uuid. В ответ будут выданы ссылки на созданные картинки.",
|
||
"consumes": [
|
||
"multipart/form-data"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch images"
|
||
],
|
||
"summary": "Загрузить картинку по merch_uuid",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Merch UUID",
|
||
"name": "uuid",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "file",
|
||
"description": "Image file",
|
||
"name": "file",
|
||
"in": "formData",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/imageStorage.UploadMerchImageResponse"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Удалить (безвозвратно) картинки по merch_uuid",
|
||
"tags": [
|
||
"Merch images"
|
||
],
|
||
"summary": "Удалить (безвозвратно) картинки по merch_uuid",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "merch_uuid",
|
||
"name": "uuid",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/merch/labels": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Получить все метки товаров",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch labels"
|
||
],
|
||
"summary": "Получить все метки товаров",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/merch.LabelsList"
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Создать новую метку для товара",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch labels"
|
||
],
|
||
"summary": "Создать новую метку для товара",
|
||
"parameters": [
|
||
{
|
||
"description": "payload",
|
||
"name": "payload",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.LabelDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/merch/labels/attach": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Прикрепить метку к товару",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch labels"
|
||
],
|
||
"summary": "Прикрепить метку к товару",
|
||
"parameters": [
|
||
{
|
||
"description": "payload",
|
||
"name": "payload",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.LabelLink"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/merch/labels/detach": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Удалить привязку метки к товару",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch labels"
|
||
],
|
||
"summary": "Удалить привязку метки к товару",
|
||
"parameters": [
|
||
{
|
||
"description": "payload",
|
||
"name": "payload",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.LabelLink"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/merch/labels/{uuid}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Получить метки товара по его uuid",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch labels"
|
||
],
|
||
"summary": "Получить метки товара по его uuid",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "label uuid",
|
||
"name": "uuid",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Изменить метку",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch labels"
|
||
],
|
||
"summary": "Изменить метку",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "label uuid",
|
||
"name": "uuid",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "payload",
|
||
"name": "payload",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.LabelDTO"
|
||
}
|
||
}
|
||
],
|
||
"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": "Пометить метку как удаленную",
|
||
"tags": [
|
||
"Merch labels"
|
||
],
|
||
"summary": "Пометить метку как удаленную",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "label uuid",
|
||
"name": "uuid",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/merch/zeroprices": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Получить нулевые цены",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch zero prices"
|
||
],
|
||
"summary": "Получить нулевые цены",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/merch.ZeroPrice"
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Пометить нулевые цены как удаленные",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch zero prices"
|
||
],
|
||
"summary": "Пометить нулевые цены как удаленные",
|
||
"parameters": [
|
||
{
|
||
"description": "payload",
|
||
"name": "payload",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.DeleteZeroPrices"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK"
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/merch/{uuid}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Получить всю информацию про мерч по его uuid",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch"
|
||
],
|
||
"summary": "Получить всю информацию про мерч",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "merch_uuid",
|
||
"name": "uuid",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.MerchDTO"
|
||
}
|
||
},
|
||
"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": [
|
||
"Merch"
|
||
],
|
||
"summary": "Пометить мерч как удаленный",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "merch_uuid",
|
||
"name": "uuid",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.MerchDTO"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/prices": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Получить цены мерча за период",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch"
|
||
],
|
||
"summary": "Получить цены мерча за период",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "period in days",
|
||
"name": "days",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/merch.PricesResponse"
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/prices/{uuid}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"BearerAuth": []
|
||
}
|
||
],
|
||
"description": "Получить перепады цен мерча за период по его merch_uuid",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Merch"
|
||
],
|
||
"summary": "Получить перепады цен мерча за период по его merch_uuid",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "merch_uuid",
|
||
"name": "uuid",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "period in days",
|
||
"name": "days",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/merch.PricesResponse"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/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"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/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"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/user/auth/login": {
|
||
"post": {
|
||
"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",
|
||
"schema": {
|
||
"$ref": "#/definitions/user.LoginResponse"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/user/auth/logout": {
|
||
"post": {
|
||
"description": "Логаут. Для логаута надо передать refresh token, он будет инвалидирован.",
|
||
"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/auth/refresh": {
|
||
"post": {
|
||
"description": "Принимает рефреш токен в http only куки",
|
||
"tags": [
|
||
"Users - auth"
|
||
],
|
||
"summary": "Обновление аксесс токена по рефреш токену.",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/user.LoginResponse"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse400"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"$ref": "#/definitions/responses.ErrorResponse500"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"definitions": {
|
||
"imageStorage.UploadMerchImageResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"fullImage": {
|
||
"type": "string"
|
||
},
|
||
"thumbnail": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.DeleteZeroPrices": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"merch_uuid": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.ImageLink": {
|
||
"type": "object",
|
||
"properties": {
|
||
"etag": {
|
||
"type": "string"
|
||
},
|
||
"link": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.LabelDTO": {
|
||
"type": "object",
|
||
"properties": {
|
||
"bg_color": {
|
||
"type": "string"
|
||
},
|
||
"color": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.LabelLink": {
|
||
"type": "object",
|
||
"properties": {
|
||
"label_uuid": {
|
||
"type": "string"
|
||
},
|
||
"merch_uuid": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.LabelsList": {
|
||
"type": "object",
|
||
"properties": {
|
||
"bg_color": {
|
||
"type": "string"
|
||
},
|
||
"color": {
|
||
"type": "string"
|
||
},
|
||
"label_uuid": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.ListResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"labels": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"merch_uuid": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.MandarakeDTO": {
|
||
"type": "object",
|
||
"properties": {
|
||
"link": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.MerchDTO": {
|
||
"type": "object",
|
||
"properties": {
|
||
"labels": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"merch_uuid": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"origin_mandarake": {
|
||
"$ref": "#/definitions/merch.MandarakeDTO"
|
||
},
|
||
"origin_surugaya": {
|
||
"$ref": "#/definitions/merch.SurugayaDTO"
|
||
}
|
||
}
|
||
},
|
||
"merch.OriginWithPrices": {
|
||
"type": "object",
|
||
"properties": {
|
||
"origin": {
|
||
"type": "integer"
|
||
},
|
||
"prices": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/merch.PriceEntry"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"merch.PriceEntry": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "integer"
|
||
},
|
||
"value": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"merch.PricesResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"merch_uuid": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"origins": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/merch.OriginWithPrices"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"merch.SurugayaDTO": {
|
||
"type": "object",
|
||
"properties": {
|
||
"link": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.UpdateMerchDTO": {
|
||
"type": "object",
|
||
"properties": {
|
||
"link": {
|
||
"type": "string"
|
||
},
|
||
"merch_uuid": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"origin": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"merch.ZeroPrice": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"merch_uuid": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"origin": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"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"
|
||
}
|
||
}
|
||
},
|
||
"shared.CurrentSession": {
|
||
"type": "object",
|
||
"properties": {
|
||
"expires": {
|
||
"type": "string"
|
||
},
|
||
"uuid": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"user.Info": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"email": {
|
||
"type": "string"
|
||
},
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"user.Login": {
|
||
"type": "object",
|
||
"properties": {
|
||
"email": {
|
||
"type": "string"
|
||
},
|
||
"password": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"user.LoginResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"access_token": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"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)
|
||
}
|