From 274495379841ce0446a023f15766d6b8ec0ca46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sun, 22 Mar 2026 15:36:52 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[=EC=88=98=EC=A3=BC=EC=84=9C]=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20URL=20=E2=86=92=20file=5Fid=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(?= =?UTF-8?q?=ED=94=84=EB=A1=9D=EC=8B=9C=20=EA=B2=BD=EC=9C=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - image_url(절대 URL) 대신 image_file_id(파일 ID)만 반환 - 프론트에서 /api/proxy/files/{id}/view 프록시로 인증 포함 요청 --- app/Services/QmsLotAuditService.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Services/QmsLotAuditService.php b/app/Services/QmsLotAuditService.php index cc8dcac9..606822a0 100644 --- a/app/Services/QmsLotAuditService.php +++ b/app/Services/QmsLotAuditService.php @@ -602,7 +602,7 @@ private function groupBendingParts($steelItems, int $shutterCount = 0): array } // 품목명 기반 이미지 매칭 - $imageUrl = null; + $imageFileId = null; if (str_contains($name, '연기차단재')) { $groupKey = '연기차단재'; } elseif ($isGuideRail) { @@ -618,24 +618,24 @@ private function groupBendingParts($steelItems, int $shutterCount = 0): array // 품목명에서 세부 키워드로 이미지 매칭 시도 foreach ($groupImageMap as $itemName => $url) { if (str_contains($name, $itemName) || str_contains($itemName, $name)) { - $imageUrl = $url; + $imageFileId = $url; break; } } // 세부 매칭 실패 시 item_bending(카테고리)으로 매칭 - if (! $imageUrl) { + if (! $imageFileId) { $bendingCategory = match ($groupKey) { '하단마감' => '하단마감재', default => $groupKey, }; - $imageUrl = $groupImageMap["_group_{$bendingCategory}"] ?? null; + $imageFileId = $groupImageMap["_group_{$bendingCategory}"] ?? null; } $row = [ 'name' => $item['item_name'], 'spec' => $item['specification'] ?? '-', 'qty' => (int) $qty, - 'image_url' => $imageUrl, + 'image_file_id' => $imageFileId, ]; if ($groupKey === '연기차단재') { @@ -670,7 +670,7 @@ private function groupBendingParts($steelItems, int $shutterCount = 0): array * item_bending(가이드레일/케이스/하단마감재 등) 기준으로 이미지가 있는 bending_item을 조회하여 * item_name → image_url, _group_{category} → image_url 매핑 반환 * - * @return array 매핑 (item_name → url, _group_카테고리 → url) + * @return array 매핑 (item_name → file_id, _group_카테고리 → file_id) */ private function getBendingGroupImages(int $tenantId): array { @@ -688,17 +688,17 @@ private function getBendingGroupImages(int $tenantId): array continue; } - $url = url("/api/v1/files/{$file->id}/view"); + $fileId = $file->id; // item_name으로 세부 매칭용 if ($bi->item_name) { - $result[$bi->item_name] = $url; + $result[$bi->item_name] = $fileId; } // item_bending(카테고리)별 첫 번째 이미지 → 그룹 대표 if ($bi->item_bending && ! isset($groupFirst[$bi->item_bending])) { - $groupFirst[$bi->item_bending] = $url; - $result["_group_{$bi->item_bending}"] = $url; + $groupFirst[$bi->item_bending] = $fileId; + $result["_group_{$bi->item_bending}"] = $fileId; } }