From 1be836273ddba6e0ddb3509a1d898535df9fd169 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 15 Mar 2023 17:29:32 +0100 Subject: core: Add OpenAPI spec Signed-off-by: jld3103 --- core/Controller/PreviewController.php | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'core/Controller/PreviewController.php') diff --git a/core/Controller/PreviewController.php b/core/Controller/PreviewController.php index 38373e2d147..c9183466f90 100644 --- a/core/Controller/PreviewController.php +++ b/core/Controller/PreviewController.php @@ -54,7 +54,20 @@ class PreviewController extends Controller { * @NoAdminRequired * @NoCSRFRequired * - * @return DataResponse|FileDisplayResponse + * Get a preview by file path + * + * @param string $file Path of the file + * @param int $x Width of the preview + * @param int $y Height of the preview + * @param bool $a Whether to not crop the preview + * @param bool $forceIcon Force returning an icon + * @param string $mode How to crop the image + * @return FileDisplayResponse|DataResponse, array{}> + * + * 200: Preview returned + * 400: Getting preview is not possible + * 403: Getting preview is not allowed + * 404: Preview not found */ public function getPreview( string $file = '', @@ -81,7 +94,20 @@ class PreviewController extends Controller { * @NoAdminRequired * @NoCSRFRequired * - * @return DataResponse|FileDisplayResponse + * Get a preview by file ID + * + * @param int $fileId ID of the file + * @param int $x Width of the preview + * @param int $y Height of the preview + * @param bool $a Whether to not crop the preview + * @param bool $forceIcon Force returning an icon + * @param string $mode How to crop the image + * @return FileDisplayResponse|DataResponse, array{}> + * + * 200: Preview returned + * 400: Getting preview is not possible + * 403: Getting preview is not allowed + * 404: Preview not found */ public function getPreviewByFileId( int $fileId = -1, @@ -107,7 +133,7 @@ class PreviewController extends Controller { } /** - * @return DataResponse|FileDisplayResponse + * @return FileDisplayResponse|DataResponse, array{}> */ private function fetchPreview( Node $node, -- cgit v1.2.3