From e3f893ac2de94ea5ebb2279259458eecf7671b1e Mon Sep 17 00:00:00 2001 From: nquidox Date: Fri, 26 Sep 2025 20:16:30 +0300 Subject: [PATCH] swagger docs update --- docs/docs.go | 53 +++++++++++++++++++++++++++++++++++++++++++++-- docs/swagger.json | 53 +++++++++++++++++++++++++++++++++++++++++++++-- docs/swagger.yaml | 35 +++++++++++++++++++++++++++++-- 3 files changed, 135 insertions(+), 6 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index c276cc9..ed5e263 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -239,7 +239,7 @@ const docTemplate = `{ "parameters": [ { "type": "string", - "description": "merch_uuid", + "description": "period in days", "name": "days", "in": "query" } @@ -269,6 +269,55 @@ const docTemplate = `{ } } }, + "/prices/{uuid}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Получить перепады цен мерча за период по его merch_uuid", + "tags": [ + "Merch" + ], + "summary": "Получить перепады цен мерча за период по его merch_uuid", + "parameters": [ + { + "type": "string", + "description": "merch_uuid", + "name": "uuid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "period in days", + "name": "days", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/merch.PricesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse400" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse500" + } + } + } + } + }, "/user": { "get": { "security": [ @@ -625,7 +674,7 @@ const docTemplate = `{ "type": "object", "properties": { "created_at": { - "type": "string" + "type": "integer" }, "value": { "type": "integer" diff --git a/docs/swagger.json b/docs/swagger.json index 864bf22..068cc35 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -231,7 +231,7 @@ "parameters": [ { "type": "string", - "description": "merch_uuid", + "description": "period in days", "name": "days", "in": "query" } @@ -261,6 +261,55 @@ } } }, + "/prices/{uuid}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Получить перепады цен мерча за период по его merch_uuid", + "tags": [ + "Merch" + ], + "summary": "Получить перепады цен мерча за период по его merch_uuid", + "parameters": [ + { + "type": "string", + "description": "merch_uuid", + "name": "uuid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "period in days", + "name": "days", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/merch.PricesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse400" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse500" + } + } + } + } + }, "/user": { "get": { "security": [ @@ -617,7 +666,7 @@ "type": "object", "properties": { "created_at": { - "type": "string" + "type": "integer" }, "value": { "type": "integer" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 255c119..20ed305 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -35,7 +35,7 @@ definitions: merch.PriceEntry: properties: created_at: - type: string + type: integer value: type: integer type: object @@ -257,7 +257,7 @@ paths: get: description: Получить цены мерча за период parameters: - - description: merch_uuid + - description: period in days in: query name: days type: string @@ -281,6 +281,37 @@ paths: summary: Получить цены мерча за период tags: - Merch + /prices/{uuid}: + get: + description: Получить перепады цен мерча за период по его merch_uuid + parameters: + - description: merch_uuid + in: path + name: uuid + required: true + type: string + - description: period in days + in: query + name: days + type: string + responses: + "200": + description: OK + schema: + $ref: '#/definitions/merch.PricesResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/responses.ErrorResponse400' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/responses.ErrorResponse500' + security: + - BearerAuth: [] + summary: Получить перепады цен мерча за период по его merch_uuid + tags: + - Merch /user: delete: description: Помечает пользователя как удаленного по его uuid из токена