swagger docs update

This commit is contained in:
nquidox 2026-03-13 16:55:14 +03:00
parent 9fe21b4b78
commit e89efaa8b9
4 changed files with 1283 additions and 216 deletions

View file

@ -120,6 +120,352 @@ const docTemplate = `{
}
}
},
"/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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
},
"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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
},
"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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
},
"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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/merch/list": {
"get": {
"description": "Get all merch without origins",
@ -136,7 +482,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/merch.merchDTO"
"$ref": "#/definitions/merch.ListResponse"
}
}
},
@ -652,6 +998,65 @@ const docTemplate = `{
}
}
},
"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.OriginWithPrices": {
"type": "object",
"properties": {

View file

@ -113,6 +113,352 @@
}
}
},
"/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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
},
"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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
},
"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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
},
"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.BadRequest"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/merch/list": {
"get": {
"description": "Get all merch without origins",
@ -129,7 +475,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/merch.merchDTO"
"$ref": "#/definitions/merch.ListResponse"
}
}
},
@ -645,6 +991,65 @@
}
}
},
"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.OriginWithPrices": {
"type": "object",
"properties": {

View file

@ -7,6 +7,44 @@ definitions:
merch_uuid:
type: string
type: object
merch.LabelDTO:
properties:
bg_color:
type: string
color:
type: string
name:
type: string
type: object
merch.LabelLink:
properties:
label_uuid:
type: string
merch_uuid:
type: string
type: object
merch.LabelsList:
properties:
bg_color:
type: string
color:
type: string
label_uuid:
type: string
name:
type: string
type: object
merch.ListResponse:
properties:
labels:
items:
type: string
type: array
merch_uuid:
type: string
name:
type: string
type: object
merch.OriginWithPrices:
properties:
origin:
@ -274,6 +312,225 @@ paths:
summary: Update merch extra data
tags:
- Merch
/merch/labels:
get:
description: Получить все метки товаров
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/merch.LabelsList'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Получить все метки товаров
tags:
- Merch labels
post:
consumes:
- application/json
description: Создать новую метку для товара
parameters:
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.LabelDTO'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Создать новую метку для товара
tags:
- Merch labels
/merch/labels/{uuid}:
delete:
description: Пометить метку как удаленную
parameters:
- description: label uuid
in: path
name: uuid
required: true
type: string
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Пометить метку как удаленную
tags:
- Merch labels
get:
description: Получить метки товара по его uuid
parameters:
- description: label uuid
in: path
name: uuid
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Получить метки товара по его uuid
tags:
- Merch labels
put:
consumes:
- application/json
description: Изменить метку
parameters:
- description: label uuid
in: path
name: uuid
required: true
type: string
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.LabelDTO'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Изменить метку
tags:
- Merch labels
/merch/labels/attach:
post:
consumes:
- application/json
description: Прикрепить метку к товару
parameters:
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.LabelLink'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Прикрепить метку к товару
tags:
- Merch labels
/merch/labels/detach:
post:
consumes:
- application/json
description: Удалить привязку метки к товару
parameters:
- description: payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/merch.LabelLink'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.BadRequest'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.Unauthorized'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.InternalServerError'
security:
- BearerAuth: []
summary: Удалить привязку метки к товару
tags:
- Merch labels
/merch/list:
get:
description: Get all merch without origins
@ -284,7 +541,7 @@ paths:
description: OK
schema:
items:
$ref: '#/definitions/merch.merchDTO'
$ref: '#/definitions/merch.ListResponse'
type: array
"204":
description: No Content