From 9dd51419bd26a5317095ecc9015cd46dc6c9bf41 Mon Sep 17 00:00:00 2001 From: nquidox Date: Wed, 24 Sep 2025 20:28:49 +0300 Subject: [PATCH] swagger docs update --- docs/docs.go | 90 +++++++++++++++++++++++++++++++++++++++++++++-- docs/swagger.json | 90 +++++++++++++++++++++++++++++++++++++++++++++-- docs/swagger.yaml | 57 ++++++++++++++++++++++++++++-- 3 files changed, 229 insertions(+), 8 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 1639277..c276cc9 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -224,6 +224,51 @@ const docTemplate = `{ } } }, + "/prices": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Получить цены мерча за период", + "tags": [ + "Merch" + ], + "summary": "Получить цены мерча за период", + "parameters": [ + { + "type": "string", + "description": "merch_uuid", + "name": "days", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$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": [ @@ -562,12 +607,51 @@ const docTemplate = `{ } } }, + "merch.OriginWithPrices": { + "type": "object", + "properties": { + "origin": { + "type": "integer" + }, + "prices": { + "type": "array", + "items": { + "$ref": "#/definitions/merch.PriceEntry" + } + } + } + }, + "merch.PriceEntry": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "merch.PricesResponse": { + "type": "object", + "properties": { + "merch_uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "origins": { + "type": "array", + "items": { + "$ref": "#/definitions/merch.OriginWithPrices" + } + } + } + }, "merch.SurugayaDTO": { "type": "object", "properties": { - "cookie_values": { - "type": "string" - }, "link": { "type": "string" } diff --git a/docs/swagger.json b/docs/swagger.json index 77964a5..864bf22 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -216,6 +216,51 @@ } } }, + "/prices": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Получить цены мерча за период", + "tags": [ + "Merch" + ], + "summary": "Получить цены мерча за период", + "parameters": [ + { + "type": "string", + "description": "merch_uuid", + "name": "days", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$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": [ @@ -554,12 +599,51 @@ } } }, + "merch.OriginWithPrices": { + "type": "object", + "properties": { + "origin": { + "type": "integer" + }, + "prices": { + "type": "array", + "items": { + "$ref": "#/definitions/merch.PriceEntry" + } + } + } + }, + "merch.PriceEntry": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "merch.PricesResponse": { + "type": "object", + "properties": { + "merch_uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "origins": { + "type": "array", + "items": { + "$ref": "#/definitions/merch.OriginWithPrices" + } + } + } + }, "merch.SurugayaDTO": { "type": "object", "properties": { - "cookie_values": { - "type": "string" - }, "link": { "type": "string" } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 2ed860a..255c119 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -23,10 +23,35 @@ definitions: origin_surugaya: $ref: '#/definitions/merch.SurugayaDTO' type: object + merch.OriginWithPrices: + properties: + origin: + type: integer + prices: + items: + $ref: '#/definitions/merch.PriceEntry' + type: array + type: object + merch.PriceEntry: + properties: + created_at: + type: string + value: + type: integer + type: object + merch.PricesResponse: + properties: + merch_uuid: + type: string + name: + type: string + origins: + items: + $ref: '#/definitions/merch.OriginWithPrices' + type: array + type: object merch.SurugayaDTO: properties: - cookie_values: - type: string link: type: string type: object @@ -228,6 +253,34 @@ paths: summary: Обновить информацию про мерч tags: - Merch + /prices: + get: + description: Получить цены мерча за период + parameters: + - description: merch_uuid + in: query + name: days + type: string + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/merch.PricesResponse' + 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 /user: delete: description: Помечает пользователя как удаленного по его uuid из токена