浏览代码

add internal road to image download

Vincent 3 月之前
父节点
当前提交
fc0bbaf79f
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/ApiResources/Core/File/Image.php

+ 5 - 0
src/ApiResources/Core/File/Image.php

@@ -23,6 +23,11 @@ use Symfony\Component\Validator\Constraints as Assert;
             security: 'is_granted("ROLE_FILE")',
             provider: ImageProvider::class
         ),
+        new Get(
+            uriTemplate: '/internal/image/download/{fileId}/{size}',
+            requirements: ['fileId' => '\\d+', 'size' => new EnumRequirement(FileSizeEnum::class)],
+            provider: ImageProvider::class
+        ),
     ]
 )]
 class Image