From e503f67bc9c48a055247659a904537e332d24a6d Mon Sep 17 00:00:00 2001 From: nquidox Date: Wed, 11 Mar 2026 20:17:40 +0300 Subject: [PATCH] swagger docs update --- docs/docs.go | 181 +++++++++++++++++++++++++++++++++++++++++++--- docs/swagger.json | 181 +++++++++++++++++++++++++++++++++++++++++++--- docs/swagger.yaml | 114 ++++++++++++++++++++++++++++- 3 files changed, 452 insertions(+), 24 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 7eac1a9..ad01399 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -293,6 +293,146 @@ const docTemplate = `{ } } }, + "/merch/zeroprices": { + "get": { + "description": "Получить нулевые цены", + "produces": [ + "application/json" + ], + "tags": [ + "Merch zero prices" + ], + "summary": "Получить нулевые цены", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/merch.ZeroPrice" + } + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/responses.Unauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.InternalServerError" + } + } + } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Пометить нулевые цены как удаленные", + "consumes": [ + "application/json" + ], + "tags": [ + "Merch zero prices" + ], + "summary": "Пометить нулевые цены как удаленные", + "parameters": [ + { + "description": "payload", + "name": "payload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/merch.DeleteZeroPrices" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.BadRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/responses.Unauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.InternalServerError" + } + } + } + } + }, + "/merch/zeroprices/period": { + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Пометить нулевые цены как удаленные за указанный период", + "tags": [ + "Merch zero prices" + ], + "summary": "Пометить нулевые цены как удаленные за указанный период", + "parameters": [ + { + "type": "string", + "description": "start", + "name": "start", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "end", + "name": "end", + "in": "query", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.BadRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/responses.Unauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.InternalServerError" + } + } + } + } + }, "/merch/{uuid}": { "put": { "description": "Update merch general info (except extra data)", @@ -396,11 +536,6 @@ const docTemplate = `{ }, "/prices": { "get": { - "security": [ - { - "BearerAuth": [] - } - ], "description": "Получить цены мерча за период", "produces": [ "application/json" @@ -450,11 +585,6 @@ const docTemplate = `{ }, "/prices/{uuid}": { "get": { - "security": [ - { - "BearerAuth": [] - } - ], "description": "Получить перепады цен мерча за период по его merch_uuid", "produces": [ "application/json" @@ -511,6 +641,17 @@ const docTemplate = `{ } }, "definitions": { + "merch.DeleteZeroPrices": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "merch_uuid": { + "type": "string" + } + } + }, "merch.OriginWithPrices": { "type": "object", "properties": { @@ -553,6 +694,26 @@ const docTemplate = `{ } } }, + "merch.ZeroPrice": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "merch_uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + } + } + }, "merch.deleteOriginDTO": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 80b6198..d2a7c3f 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -286,6 +286,146 @@ } } }, + "/merch/zeroprices": { + "get": { + "description": "Получить нулевые цены", + "produces": [ + "application/json" + ], + "tags": [ + "Merch zero prices" + ], + "summary": "Получить нулевые цены", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/merch.ZeroPrice" + } + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/responses.Unauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.InternalServerError" + } + } + } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Пометить нулевые цены как удаленные", + "consumes": [ + "application/json" + ], + "tags": [ + "Merch zero prices" + ], + "summary": "Пометить нулевые цены как удаленные", + "parameters": [ + { + "description": "payload", + "name": "payload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/merch.DeleteZeroPrices" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.BadRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/responses.Unauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.InternalServerError" + } + } + } + } + }, + "/merch/zeroprices/period": { + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Пометить нулевые цены как удаленные за указанный период", + "tags": [ + "Merch zero prices" + ], + "summary": "Пометить нулевые цены как удаленные за указанный период", + "parameters": [ + { + "type": "string", + "description": "start", + "name": "start", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "end", + "name": "end", + "in": "query", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.BadRequest" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/responses.Unauthorized" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.InternalServerError" + } + } + } + } + }, "/merch/{uuid}": { "put": { "description": "Update merch general info (except extra data)", @@ -389,11 +529,6 @@ }, "/prices": { "get": { - "security": [ - { - "BearerAuth": [] - } - ], "description": "Получить цены мерча за период", "produces": [ "application/json" @@ -443,11 +578,6 @@ }, "/prices/{uuid}": { "get": { - "security": [ - { - "BearerAuth": [] - } - ], "description": "Получить перепады цен мерча за период по его merch_uuid", "produces": [ "application/json" @@ -504,6 +634,17 @@ } }, "definitions": { + "merch.DeleteZeroPrices": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "merch_uuid": { + "type": "string" + } + } + }, "merch.OriginWithPrices": { "type": "object", "properties": { @@ -546,6 +687,26 @@ } } }, + "merch.ZeroPrice": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "merch_uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + } + } + }, "merch.deleteOriginDTO": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index c0bd2eb..c064302 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,5 +1,12 @@ basePath: /api/v2 definitions: + merch.DeleteZeroPrices: + properties: + id: + type: integer + merch_uuid: + type: string + type: object merch.OriginWithPrices: properties: origin: @@ -27,6 +34,19 @@ definitions: $ref: '#/definitions/merch.OriginWithPrices' type: array type: object + merch.ZeroPrice: + properties: + created_at: + type: string + id: + type: integer + merch_uuid: + type: string + name: + type: string + origin: + type: string + type: object merch.deleteOriginDTO: properties: name: @@ -368,6 +388,96 @@ paths: summary: Create new origin tags: - Origins + /merch/zeroprices: + delete: + consumes: + - application/json + description: Пометить нулевые цены как удаленные + parameters: + - description: payload + in: body + name: payload + required: true + schema: + $ref: '#/definitions/merch.DeleteZeroPrices' + responses: + "204": + description: No Content + "400": + description: Bad Request + schema: + $ref: '#/definitions/responses.BadRequest' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/responses.Unauthorized' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/responses.InternalServerError' + security: + - BearerAuth: [] + summary: Пометить нулевые цены как удаленные + tags: + - Merch zero prices + get: + description: Получить нулевые цены + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/merch.ZeroPrice' + type: array + "204": + description: No Content + "401": + description: Unauthorized + schema: + $ref: '#/definitions/responses.Unauthorized' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/responses.InternalServerError' + summary: Получить нулевые цены + tags: + - Merch zero prices + /merch/zeroprices/period: + delete: + description: Пометить нулевые цены как удаленные за указанный период + parameters: + - description: start + in: query + name: start + required: true + type: string + - description: end + in: query + name: end + required: true + type: string + responses: + "204": + description: No Content + "400": + description: Bad Request + schema: + $ref: '#/definitions/responses.BadRequest' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/responses.Unauthorized' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/responses.InternalServerError' + security: + - BearerAuth: [] + summary: Пометить нулевые цены как удаленные за указанный период + tags: + - Merch zero prices /prices: get: description: Получить цены мерча за период @@ -397,8 +507,6 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/responses.InternalServerError' - security: - - BearerAuth: [] summary: Получить цены мерча за период tags: - Merch @@ -436,8 +544,6 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/responses.InternalServerError' - security: - - BearerAuth: [] summary: Получить перепады цен мерча за период по его merch_uuid tags: - Merch