From a6e6917bac7d9be3a96adff13df9bfec3d0901b8 Mon Sep 17 00:00:00 2001 From: nquidox Date: Mon, 15 Sep 2025 15:13:56 +0300 Subject: [PATCH] swagger docs update --- docs/docs.go | 81 +++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.json | 81 +++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.yaml | 51 +++++++++++++++++++++++++++++ 3 files changed, 213 insertions(+) diff --git a/docs/docs.go b/docs/docs.go index 8f908f6..986810e 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -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": { diff --git a/docs/swagger.json b/docs/swagger.json index 04dc6da..8f5f16e 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -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": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index a8f1531..5e63691 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -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 из токена