{ "openapi": "3.0.0", "info": { "title": "Photo load and upload", "contact": { "email": "sav@net-bit.ru" }, "version": "1.0" }, "paths": { "/api/admin/gallery/create": { "post": { "tags": [ "admin" ], "summary": "Создает галерею, ее имя и будет являться ключем для галереи", "description": "Create new gallery", "operationId": "createGallery", "responses": { "400": { "description": "Invalid input" }, "200": { "description": "successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Gallery" } } } } } } }, "/api/admin/gallery/remove/{id}": { "delete": { "tags": [ "admin" ], "summary": "Удаляет галерею вместе с содержимым", "description": "Remove gallery with all photo", "operationId": "removeGallery", "parameters": [ { "name": "id", "in": "path", "description": "Идентификатор галереи", "required": true, "schema": { "type": "string" } } ], "responses": { "400": { "description": "Invalid input" }, "200": { "description": "Success delete" } } } }, "/api/admin/gallery/list": { "get": { "tags": [ "admin" ], "summary": "Возвращает список галерей", "description": "Get list gallery", "operationId": "getGalleryList", "responses": { "400": { "description": "Invalid input" }, "200": { "description": "Список существующих галерей, без файлов.", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Gallery" } } } } } } } }, "/api/admin/file/upload/{galleryId}": { "post": { "tags": [ "admin" ], "summary": "Загрузка файлов", "description": "Upload file in gallery", "operationId": "uploadFile", "parameters": [ { "name": "galleryId", "in": "path", "description": "Идентификатор галереи", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "required": [ "file" ], "properties": { "file": { "description": "Photo file", "type": "string", "format": "binary" } }, "type": "object" } } } }, "responses": { "400": { "description": "Invalid input" }, "200": { "description": "successful operation", "content": { "application/json": { "schema": { "properties": { "fileId": { "description": "Идентификатор фотографии", "type": "string", "example": "1bc29b36f623ba82aaf6724fd3b16718" }, "galleryId": { "description": "Идентификатор галереи", "type": "string", "example": "1bc29b36f623ba82aaf6724fd3b16718" } }, "type": "object" } } } } } } }, "/api/admin/file/remove/{galleryId}/{fileId} ": { "delete": { "tags": [ "admin" ], "summary": "Удаляет фотографию из галереи", "description": "Remove file in gallery", "operationId": "removeFile", "parameters": [ { "name": "galleryId", "in": "path", "description": "Идентификатор галереи", "required": true, "schema": { "type": "string" } }, { "name": "fileId", "in": "path", "description": "Идентификатор фотографии", "required": true, "schema": { "type": "string" } } ], "responses": { "400": { "description": "Invalid input" }, "200": { "description": "Success delete" } } } }, "/api/access/gallery/{id}": { "get": { "tags": [ "use" ], "summary": "Возвращает список файлов в галереи", "description": "Get list files in gallery", "operationId": "getGallery", "parameters": [ { "name": "id", "in": "path", "description": "Идентификатор галереи", "required": true, "schema": { "type": "string" } } ], "responses": { "400": { "description": "Invalid input" }, "200": { "description": "successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Gallery" } } } } } } }, "/api/access/gallery/file/{galleryId}/{fileId}": { "get": { "tags": [ "use" ], "summary": "Отдает запрошенный файл из указанной галереи", "description": "Get file from gallery", "operationId": "getPhoto", "parameters": [ { "name": "galleryId", "in": "path", "description": "Идентификатор галереи", "required": true, "schema": { "type": "string" } }, { "name": "fileId", "in": "path", "description": "Идентификатор файла", "required": true, "schema": { "type": "string" } } ], "responses": { "400": { "description": "Invalid input" }, "200": { "description": "Download file" } } } } }, "components": { "schemas": { "Gallery": { "title": "Gallery", "description": "DTO описывающая галерею", "properties": { "name": { "title": "Имя галереи", "type": "string" }, "files": { "title": "Список фотографий", "type": "array", "items": { "type": "string" } } }, "type": "object" } } } }