swagger docs update

This commit is contained in:
nquidox 2025-09-15 15:13:56 +03:00
parent 03e114db0b
commit a6e6917bac
3 changed files with 213 additions and 0 deletions

View file

@ -15,6 +15,51 @@ const docTemplate = `{
"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"
}
}
}
}
},
"/user": {
"get": {
"security": [
@ -317,6 +362,42 @@ const docTemplate = `{
}
},
"definitions": {
"merch.MandarakeDTO": {
"type": "object",
"properties": {
"link": {
"type": "string"
}
}
},
"merch.MerchDTO": {
"type": "object",
"properties": {
"merch_uuid": {
"type": "string"
},
"name": {
"type": "string"
},
"origin_mandarake": {
"$ref": "#/definitions/merch.MandarakeDTO"
},
"origin_surugaya": {
"$ref": "#/definitions/merch.SurugayaDTO"
}
}
},
"merch.SurugayaDTO": {
"type": "object",
"properties": {
"cookie_values": {
"type": "string"
},
"link": {
"type": "string"
}
}
},
"responses.ErrorResponse400": {
"type": "object",
"properties": {

View file

@ -7,6 +7,51 @@
},
"basePath": "/api/v2",
"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"
}
}
}
}
},
"/user": {
"get": {
"security": [
@ -309,6 +354,42 @@
}
},
"definitions": {
"merch.MandarakeDTO": {
"type": "object",
"properties": {
"link": {
"type": "string"
}
}
},
"merch.MerchDTO": {
"type": "object",
"properties": {
"merch_uuid": {
"type": "string"
},
"name": {
"type": "string"
},
"origin_mandarake": {
"$ref": "#/definitions/merch.MandarakeDTO"
},
"origin_surugaya": {
"$ref": "#/definitions/merch.SurugayaDTO"
}
}
},
"merch.SurugayaDTO": {
"type": "object",
"properties": {
"cookie_values": {
"type": "string"
},
"link": {
"type": "string"
}
}
},
"responses.ErrorResponse400": {
"type": "object",
"properties": {

View file

@ -1,5 +1,28 @@
basePath: /api/v2
definitions:
merch.MandarakeDTO:
properties:
link:
type: string
type: object
merch.MerchDTO:
properties:
merch_uuid:
type: string
name:
type: string
origin_mandarake:
$ref: '#/definitions/merch.MandarakeDTO'
origin_surugaya:
$ref: '#/definitions/merch.SurugayaDTO'
type: object
merch.SurugayaDTO:
properties:
cookie_values:
type: string
link:
type: string
type: object
responses.ErrorResponse400:
properties:
error:
@ -67,6 +90,34 @@ info:
title: Merch Parser
version: 2.0.0-alpha
paths:
/merch:
post:
consumes:
- application/json
description: Добавить новый мерч
parameters:
- description: новый мерч
in: body
name: 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'
security:
- BearerAuth: []
summary: Добавить новый мерч
tags:
- Merch
/user:
delete:
description: Помечает пользователя как удаленного по его uuid из токена