From ccdc28c44e6e2bd5c3864324e7739384b45d99e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 21 Mar 2026 09:40:11 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[bending]=20=EC=A0=88=EA=B3=A1=ED=92=88?= =?UTF-8?q?=20API=20=ED=99=94=EC=9D=B4=ED=8A=B8=EB=A6=AC=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20presignedUrl=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=ED=95=B8=EB=93=A4=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bending-items, guiderail-models 등 MNG→API 호출 라우트 화이트리스트 등록 - BendingItemResource에서 S3 미설정 환경 presignedUrl 에러 try-catch 처리 --- app/Http/Middleware/ApiKeyMiddleware.php | 6 ++++++ app/Http/Resources/Api/V1/BendingItemResource.php | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/ApiKeyMiddleware.php b/app/Http/Middleware/ApiKeyMiddleware.php index 707ce3ce..6795a8c5 100644 --- a/app/Http/Middleware/ApiKeyMiddleware.php +++ b/app/Http/Middleware/ApiKeyMiddleware.php @@ -143,6 +143,12 @@ public function handle(Request $request, Closure $next) 'api/v1/internal/exchange-token', // 내부 서버간 토큰 교환 (HMAC 인증 사용) 'api/v1/admin/fcm/*', // Admin FCM API (MNG에서 API Key만으로 접근) 'api/v1/app/*', // 앱 버전 확인/다운로드 (API Key만 필요) + 'api/v1/bending-items', // 절곡 기초관리 (MNG에서 API Key + X-TENANT-ID로 접근) + 'api/v1/bending-items/*', // 절곡 기초관리 상세/수정/삭제 + 'api/v1/guiderail-models', // 절곡품 가이드레일 (MNG에서 API Key + X-TENANT-ID로 접근) + 'api/v1/guiderail-models/*', // 절곡품 가이드레일 상세 + 'api/v1/items/*/files', // 품목 파일 (절곡품 이미지 업로드/조회) + 'api/v1/files/*/presigned-url', // 파일 presigned URL (이미지 표시) ]; // 현재 라우트 확인 (경로 또는 이름) diff --git a/app/Http/Resources/Api/V1/BendingItemResource.php b/app/Http/Resources/Api/V1/BendingItemResource.php index ef5ee98a..0bf13c76 100644 --- a/app/Http/Resources/Api/V1/BendingItemResource.php +++ b/app/Http/Resources/Api/V1/BendingItemResource.php @@ -76,6 +76,10 @@ private function getImageFileId(): ?int private function getImageUrl(): ?string { - return $this->getImageFile()?->presignedUrl(); + try { + return $this->getImageFile()?->presignedUrl(); + } catch (\Throwable) { + return null; + } } }