diff --git a/docs/docs.go b/docs/docs.go index ecfa982..4498bb4 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -115,6 +115,46 @@ const docTemplate = `{ } } } + }, + "/map/{id}/snfm": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Redirects to a signed download URL for a map's SNFM file", + "tags": [ + "maps" + ], + "summary": "Download SNFM file", + "parameters": [ + { + "type": "integer", + "description": "Map ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "307": { + "description": "Redirect to signed S3 URL" + }, + "404": { + "description": "Map not found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "General error response", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } } }, "definitions": { diff --git a/docs/swagger.json b/docs/swagger.json index 3465447..da4f96d 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -108,6 +108,46 @@ } } } + }, + "/map/{id}/snfm": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Redirects to a signed download URL for a map's SNFM file", + "tags": [ + "maps" + ], + "summary": "Download SNFM file", + "parameters": [ + { + "type": "integer", + "description": "Map ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "307": { + "description": "Redirect to signed S3 URL" + }, + "404": { + "description": "Map not found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "default": { + "description": "General error response", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } } }, "definitions": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ffc6d9c..b402668 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -133,6 +133,31 @@ paths: summary: Get map by ID tags: - maps + /map/{id}/snfm: + get: + description: Redirects to a signed download URL for a map's SNFM file + parameters: + - description: Map ID + in: path + name: id + required: true + type: integer + responses: + "307": + description: Redirect to signed S3 URL + "404": + description: Map not found + schema: + $ref: '#/definitions/Error' + default: + description: General error response + schema: + $ref: '#/definitions/Error' + security: + - ApiKeyAuth: [] + summary: Download SNFM file + tags: + - maps securityDefinitions: ApiKeyAuth: in: header diff --git a/generate.go b/generate.go index 5a37007..c3c141c 100644 --- a/generate.go +++ b/generate.go @@ -1,4 +1,4 @@ package main -//go:generate swag init -g ./cmd/maps-service/service.go +//go:generate go run github.com/swaggo/swag/cmd/swag@latest init -g ./cmd/maps-service/service.go //go:generate go run github.com/ogen-go/ogen/cmd/ogen@latest --target pkg/api --clean openapi.yaml