From ff81fcc1ce89fc74186d9d49fe4e9ddcae45713b Mon Sep 17 00:00:00 2001 From: nquidox Date: Thu, 18 Sep 2025 17:09:58 +0300 Subject: [PATCH] swagger docs update --- docs/docs.go | 132 ++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.json | 132 ++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.yaml | 83 +++++++++++++++++++++++++++++ 3 files changed, 347 insertions(+) diff --git a/docs/docs.go b/docs/docs.go index 986810e..9bc88cb 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -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": { diff --git a/docs/swagger.json b/docs/swagger.json index 8f5f16e..33d9bf8 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -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": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 5e63691..a377e8e 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -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 из токена