logApiUsage('modules.assets', ['identifier' => $identifier, 'path' => $path]); // Service에서 파일 경로 조회 (검증은 FormRequest에서 완료됨) $result = $this->moduleService->getAssetFilePath($identifier, $path); // 에러 처리 if (! $result['success']) { return match ($result['error']) { 'module_not_found' => $this->notFound(__('modules.errors.not_found', ['module' => $identifier])), 'file_not_found' => $this->notFound(__('modules.errors.file_not_found')), 'file_type_not_allowed' => $this->forbidden(__('modules.errors.file_type_not_allowed')), default => $this->error(__('modules.errors.unknown_error'), 500), }; } // 파일 반환 (ETag 및 환경별 캐싱 헤더 포함, 1년 캐시) return $this->fileResponse($result['filePath'], $result['mimeType'], 31536000); } }