diff --git a/package.json b/package.json index 5586553..aa3a5a3 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dev": "vite", "clean": "rimraf dist", "build": "npm run clean && vite build", - "deploy:nas": "node -e 'const isWin = process.platform === \"win32\"; const src = \"dist\"; const dstWin = \"Z:\\\\docker\\\\webpage\\\\frontend\\\\\"; const dstMac = \"/Volumes/gahusb.synology.me/docker/webpage/frontend/\"; const dst = isWin ? dstWin : dstMac; const fs = require(\"fs\"); if (!fs.existsSync(src)) { console.error(\"dist not found. Run build first.\"); process.exit(1); } if (!fs.existsSync(dst)) { console.error(\"NAS path not found. Check mount: \" + dst); process.exit(1); } if (isWin) { const cmd = \"powershell -NoProfile -ExecutionPolicy Bypass -Command \\\"$ErrorActionPreference=\\\"Stop\\\"; $src=\\\"dist\\\"; $dst=\\\"Z:\\\\docker\\\\webpage\\\\frontend\\\\\\\"; if(!(Test-Path $src)){ throw \\\"dist not found. Run build first.\\\" }; if(!(Test-Path $dst)){ throw \\\"NAS drive not found. Check Z: mapping.\\\" }; robocopy $src $dst /MIR /R:1 /W:1 /E /NFL /NDL /NP; if($LASTEXITCODE -ge 8){ exit $LASTEXITCODE }\\\"\"; require(\"child_process\").execSync(cmd); } else { require(\"child_process\").execSync(\"rsync -av --delete --delete-delay --inplace dist/ \" + dst); }'", + "deploy:nas": "node scripts/deploy-nas.cjs", "release:nas": "npm run build && npm run deploy:nas", "lint": "eslint .", "preview": "vite preview" diff --git a/public/lotto-api.md b/public/lotto-api.md new file mode 100644 index 0000000..1669c10 --- /dev/null +++ b/public/lotto-api.md @@ -0,0 +1,63 @@ +# Lotto API 스펙 (프론트 참고) + +## 추천 1개 생성 + +요청: + +GET /api/lotto/recommend?recent_window=200&recent_weight=2.0&avoid_recent_k=5&sum_min=120&sum_max=180&max_overlap_latest=1 + +응답 핵심: + +{ + "id": 123, + "saved": true, + "deduped": false, + "numbers": [1,2,3,4,5,6], + "based_on_latest_draw": 1145, + "explain": {...}, + "metrics": {...}, + "recent_overlap": {...}, + "params": {...} +} + +## 히스토리 목록 (페이지/필터/검색) + +기본: GET /api/history?limit=30&offset=0 +즐겨찾기만: GET /api/history?favorite=true +태그 필터: GET /api/history?tag=jeju +메모 검색: GET /api/history?q=맛집 +정렬: GET /api/history?sort=favorite_desc + +응답: + +{ + "items": [ + { + "id": 123, + "created_at": "...", + "numbers": [...], + "params": {...}, + "based_on_draw": 1145, + "favorite": false, + "note": null, + "tags": [], + "metrics": {...}, + "recent_overlap": {...} + } + ], + "limit": 30, + "offset": 0, + "filters": {...} +} + +## 히스토리 수정 (즐겨찾기/메모/태그) + +요청: + +PATCH /api/history/{id} + +{ + "favorite": true, + "note": "이번주는 이 조합", + "tags": ["jeju","safe"] +} diff --git a/scripts/deploy-nas.cjs b/scripts/deploy-nas.cjs new file mode 100644 index 0000000..830d329 --- /dev/null +++ b/scripts/deploy-nas.cjs @@ -0,0 +1,27 @@ +const { execSync } = require("child_process"); +const fs = require("fs"); + +const isWin = process.platform === "win32"; +const src = "dist"; +const dstWin = "Z:\\docker\\webpage\\frontend\\"; +const dstMac = "/Volumes/gahusb.synology.me/docker/webpage/frontend/"; +const dst = isWin ? dstWin : dstMac; + +if (!fs.existsSync(src)) { + console.error("dist not found. Run build first."); + process.exit(1); +} +if (!fs.existsSync(dst)) { + console.error("NAS path not found. Check mount: " + dst); + process.exit(1); +} + +if (isWin) { + const cmd = + 'powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference=\\"Stop\\"; $src=\\"dist\\"; $dst=\\"Z:\\\\docker\\\\webpage\\\\frontend\\\\\\"; if(!(Test-Path $src)){ throw \\"dist not found. Run build first.\\" }; if(!(Test-Path $dst)){ throw \\"NAS drive not found. Check Z: mapping.\\" }; $log = Join-Path (Get-Location) \\"robocopy.log\\"; robocopy $src $dst /MIR /R:1 /W:1 /E /NFL /NDL /NP /V /TEE /LOG:$log; $rc = $LASTEXITCODE; if($rc -ge 8){ Write-Host \\"robocopy failed with code $rc. See $log\\"; exit $rc } else { exit 0 }"'; + execSync(cmd, { stdio: "inherit" }); +} else { + execSync(`rsync -av --delete --delete-delay --inplace ${src}/ ${dst}`, { + stdio: "inherit", + }); +} diff --git a/src/pages/lotto/Functions.jsx b/src/pages/lotto/Functions.jsx index 1122ba8..41ac9a6 100644 --- a/src/pages/lotto/Functions.jsx +++ b/src/pages/lotto/Functions.jsx @@ -360,7 +360,10 @@ export default function Functions() { ); diff --git a/src/pages/lotto/Lotto.css b/src/pages/lotto/Lotto.css index 72582cc..c80e3fe 100644 --- a/src/pages/lotto/Lotto.css +++ b/src/pages/lotto/Lotto.css @@ -322,6 +322,10 @@ font-size: 12px; } +.lotto-foot__link { + color: var(--accent); +} + .button.danger { border-color: rgba(247, 116, 125, 0.5); color: #fbc4c8;