diff --git a/docs/docs.go b/docs/docs.go index ed5e263..4901f76 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -95,6 +95,207 @@ const docTemplate = `{ } } } + }, + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Обновить информацию про мерч по его uuid в json-е", + "tags": [ + "Merch" + ], + "summary": "Обновить информацию про мерч", + "parameters": [ + { + "description": "merch_uuid", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/merch.UpdateMerchDTO" + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse400" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse500" + } + } + } + } + }, + "/merch/images/{uuid}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Получить картинки по merch_uuid и query параметрам", + "tags": [ + "Merch images" + ], + "summary": "Получить картинки по merch_uuid и query параметрам", + "parameters": [ + { + "type": "string", + "description": "merch_uuid", + "name": "uuid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "image type", + "name": "type", + "in": "query", + "required": true + } + ], + "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" + } + } + } + }, + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Загрузить картинки по merch_uuid и query параметрам", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Merch images" + ], + "summary": "Загрузить картинки по merch_uuid и query параметрам", + "parameters": [ + { + "type": "string", + "description": "Merch UUID", + "name": "uuid", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "Image file", + "name": "file", + "in": "formData", + "required": true + }, + { + "enum": [ + "thumbnail", + "full", + "all" + ], + "type": "string", + "description": "Image type: thumbnail, full or all", + "name": "imageType", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse400" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse500" + } + } + } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Удалить (безвозвратно) картинки по merch_uuid и query параметрам", + "tags": [ + "Merch images" + ], + "summary": "Удалить (безвозвратно) картинки по merch_uuid и query параметрам", + "parameters": [ + { + "type": "string", + "description": "merch_uuid", + "name": "uuid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "image type", + "name": "type", + "in": "query", + "required": true + } + ], + "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" + } + } + } } }, "/merch/{uuid}": { @@ -139,49 +340,6 @@ const docTemplate = `{ } } }, - "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": [ { @@ -706,6 +864,23 @@ const docTemplate = `{ } } }, + "merch.UpdateMerchDTO": { + "type": "object", + "properties": { + "link": { + "type": "string" + }, + "merch_uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + } + } + }, "responses.ErrorResponse400": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 068cc35..a1b5b73 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -87,6 +87,207 @@ } } } + }, + "put": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Обновить информацию про мерч по его uuid в json-е", + "tags": [ + "Merch" + ], + "summary": "Обновить информацию про мерч", + "parameters": [ + { + "description": "merch_uuid", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/merch.UpdateMerchDTO" + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse400" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse500" + } + } + } + } + }, + "/merch/images/{uuid}": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Получить картинки по merch_uuid и query параметрам", + "tags": [ + "Merch images" + ], + "summary": "Получить картинки по merch_uuid и query параметрам", + "parameters": [ + { + "type": "string", + "description": "merch_uuid", + "name": "uuid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "image type", + "name": "type", + "in": "query", + "required": true + } + ], + "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" + } + } + } + }, + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Загрузить картинки по merch_uuid и query параметрам", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Merch images" + ], + "summary": "Загрузить картинки по merch_uuid и query параметрам", + "parameters": [ + { + "type": "string", + "description": "Merch UUID", + "name": "uuid", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "Image file", + "name": "file", + "in": "formData", + "required": true + }, + { + "enum": [ + "thumbnail", + "full", + "all" + ], + "type": "string", + "description": "Image type: thumbnail, full or all", + "name": "imageType", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse400" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/responses.ErrorResponse500" + } + } + } + }, + "delete": { + "security": [ + { + "BearerAuth": [] + } + ], + "description": "Удалить (безвозвратно) картинки по merch_uuid и query параметрам", + "tags": [ + "Merch images" + ], + "summary": "Удалить (безвозвратно) картинки по merch_uuid и query параметрам", + "parameters": [ + { + "type": "string", + "description": "merch_uuid", + "name": "uuid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "image type", + "name": "type", + "in": "query", + "required": true + } + ], + "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" + } + } + } } }, "/merch/{uuid}": { @@ -131,49 +332,6 @@ } } }, - "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": [ { @@ -698,6 +856,23 @@ } } }, + "merch.UpdateMerchDTO": { + "type": "object", + "properties": { + "link": { + "type": "string" + }, + "merch_uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + } + } + }, "responses.ErrorResponse400": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 20ed305..2d9d9bc 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -55,6 +55,17 @@ definitions: link: type: string type: object + merch.UpdateMerchDTO: + properties: + link: + type: string + merch_uuid: + type: string + name: + type: string + origin: + type: string + type: object responses.ErrorResponse400: properties: error: @@ -173,6 +184,31 @@ paths: summary: Получить все записи мерча tags: - Merch + put: + description: Обновить информацию про мерч по его uuid в json-е + parameters: + - description: merch_uuid + in: body + name: body + required: true + schema: + $ref: '#/definitions/merch.UpdateMerchDTO' + 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 /merch/{uuid}: delete: description: Пометить мерч как удаленный по его uuid @@ -226,20 +262,25 @@ paths: summary: Получить всю информацию про мерч tags: - Merch - put: - description: Обновить информацию про мерч по его uuid в json-е + /merch/images/{uuid}: + delete: + description: Удалить (безвозвратно) картинки по merch_uuid и query параметрам parameters: - description: merch_uuid - in: body - name: body + in: path + name: uuid required: true - schema: - $ref: '#/definitions/merch.MerchDTO' + type: string + - description: image type + in: query + name: type + required: true + type: string responses: "200": description: OK schema: - $ref: '#/definitions/merch.MerchDTO' + $ref: '#/definitions/merch.PricesResponse' "400": description: Bad Request schema: @@ -250,9 +291,82 @@ paths: $ref: '#/definitions/responses.ErrorResponse500' security: - BearerAuth: [] - summary: Обновить информацию про мерч + summary: Удалить (безвозвратно) картинки по merch_uuid и query параметрам tags: - - Merch + - Merch images + get: + description: Получить картинки по merch_uuid и query параметрам + parameters: + - description: merch_uuid + in: path + name: uuid + required: true + type: string + - description: image type + in: query + name: type + required: true + 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 и query параметрам + tags: + - Merch images + post: + consumes: + - multipart/form-data + description: Загрузить картинки по merch_uuid и query параметрам + parameters: + - description: Merch UUID + in: path + name: uuid + required: true + type: string + - description: Image file + in: formData + name: file + required: true + type: file + - description: 'Image type: thumbnail, full or all' + enum: + - thumbnail + - full + - all + in: formData + name: imageType + required: true + type: string + produces: + - application/json + 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: Загрузить картинки по merch_uuid и query параметрам + tags: + - Merch images /prices: get: description: Получить цены мерча за период