From 81d977b97da7697f7c22607056ea257e1679fbc8 Mon Sep 17 00:00:00 2001 From: Jay Sheen Date: Tue, 21 Oct 2025 15:53:35 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=8F=85=EB=A6=BD=EC=A0=81=EC=9D=B8=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - React 앱과 완전히 독립된 HTML 페이지 생성 (/download) - URL 파라미터 검증 (key, expired_time) - 만료 시간 체크 및 적절한 화면 표시 - 사업자번호 입력 및 자동 포맷팅 (xxx-xxxxx-xx) - 파일 다운로드 기능 (테스트 모드 포함) - 반응형 디자인 및 모바일 최적화 - 클린 코드 및 모듈 패턴 적용 🤖 Generated with Claude Code Co-Authored-By: Claude --- public/download.html | 519 ++++++++++++++++++++++++++++++++++++++++ src/api/download-api.ts | 68 ++++++ 2 files changed, 587 insertions(+) create mode 100644 public/download.html create mode 100644 src/api/download-api.ts diff --git a/public/download.html b/public/download.html new file mode 100644 index 0000000..eb91e7e --- /dev/null +++ b/public/download.html @@ -0,0 +1,519 @@ + + + + + + + 나이스가맹점관리자 - 파일 다운로드 + + + + + + + +
+ + + + + + + + +
+ + + + \ No newline at end of file diff --git a/src/api/download-api.ts b/src/api/download-api.ts new file mode 100644 index 0000000..d26d828 --- /dev/null +++ b/src/api/download-api.ts @@ -0,0 +1,68 @@ +import axios from 'axios'; + +interface DownloadValidationRequest { + key: string; + password: string; +} + +interface DownloadValidationResponse { + success: boolean; + downloadUrl?: string; + message?: string; +} + +/** + * Validate download password and get download URL + * @param key - UUID key from URL parameter + * @param password - Business registration number (사업자번호) + * @returns Promise with download URL if validation succeeds + */ +export async function validateDownloadPassword( + key: string, + password: string +): Promise { + try { + const response = await axios.post( + '/api/download/validate', + { + key, + password, + } as DownloadValidationRequest + ); + + return response.data; + } catch (error) { + if (axios.isAxiosError(error)) { + return { + success: false, + message: error.response?.data?.message || '비밀번호가 일치하지 않습니다.', + }; + } + + return { + success: false, + message: '오류가 발생했습니다. 다시 시도해 주세요.', + }; + } +} + +/** + * Generate secure download link + * @param merchantId - Merchant ID + * @param fileType - Type of file to download + * @returns Promise with download key and URL + */ +export async function generateDownloadLink( + merchantId: string, + fileType: string +): Promise<{ key: string; url: string }> { + const response = await axios.post<{ key: string; url: string }>( + '/api/download/generate', + { + merchantId, + fileType, + } + ); + + return response.data; +} \ No newline at end of file