swagger docs update

This commit is contained in:
nquidox 2025-09-18 17:09:58 +03:00
parent 3ff0e6d641
commit ff81fcc1ce
3 changed files with 347 additions and 0 deletions

View file

@ -60,6 +60,127 @@ const docTemplate = `{
}
}
},
"/merch/{uuid}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Получить все записи мерча",
"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-е",
"tags": [
"Merch"
],
"summary": "Обновить информацию про мерч",
"parameters": [
{
"description": "merch_uuid",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/merch.MerchDTO"
}
}
],
"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"
}
}
}
}
},
"/user": {
"get": {
"security": [
@ -362,6 +483,17 @@ const docTemplate = `{
}
},
"definitions": {
"merch.ListResponse": {
"type": "object",
"properties": {
"merch_uuid": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"merch.MandarakeDTO": {
"type": "object",
"properties": {

View file

@ -52,6 +52,127 @@
}
}
},
"/merch/{uuid}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Получить все записи мерча",
"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-е",
"tags": [
"Merch"
],
"summary": "Обновить информацию про мерч",
"parameters": [
{
"description": "merch_uuid",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/merch.MerchDTO"
}
}
],
"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"
}
}
}
}
},
"/user": {
"get": {
"security": [
@ -354,6 +475,17 @@
}
},
"definitions": {
"merch.ListResponse": {
"type": "object",
"properties": {
"merch_uuid": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"merch.MandarakeDTO": {
"type": "object",
"properties": {

View file

@ -1,5 +1,12 @@
basePath: /api/v2
definitions:
merch.ListResponse:
properties:
merch_uuid:
type: string
name:
type: string
type: object
merch.MandarakeDTO:
properties:
link:
@ -118,6 +125,82 @@ paths:
summary: Добавить новый мерч
tags:
- Merch
/merch/{uuid}:
delete:
description: Пометить мерч как удаленный по его uuid
parameters:
- description: merch_uuid
in: path
name: uuid
required: true
type: string
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'
security:
- BearerAuth: []
summary: Пометить мерч как удаленный
tags:
- Merch
get:
description: Получить все записи мерча
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/merch.ListResponse'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
security:
- BearerAuth: []
summary: Получить все записи мерча
tags:
- Merch
put:
description: Обновить информацию про мерч по его uuid в json-е
parameters:
- description: merch_uuid
in: body
name: body
required: true
schema:
$ref: '#/definitions/merch.MerchDTO'
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'
security:
- BearerAuth: []
summary: Обновить информацию про мерч
tags:
- Merch
/user:
delete:
description: Помечает пользователя как удаленного по его uuid из токена