feat: [file] path 기반 presigned URL 엔드포인트 추가
- POST /api/v1/files/presigned-url-by-path 추가 - file_id 없이 image_path만 있는 레거시 데이터 지원
This commit is contained in:
@@ -145,6 +145,21 @@ public function presignedUrl(int $id, Request $request)
|
||||
return ApiResponse::handle(fn () => ['url' => $url]);
|
||||
}
|
||||
|
||||
/**
|
||||
* R2 Presigned URL 발급 (file_path 기반, 30분 유효)
|
||||
*/
|
||||
public function presignedUrlByPath(Request $request)
|
||||
{
|
||||
$path = $request->input('path');
|
||||
if (! $path) {
|
||||
abort(400, 'path is required');
|
||||
}
|
||||
|
||||
$url = Storage::disk('r2')->temporaryUrl($path, now()->addMinutes(30));
|
||||
|
||||
return ApiResponse::handle(fn () => ['url' => $url]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft delete file
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user