diff --git a/app/modules/cafe24/router.py b/app/modules/cafe24/router.py index 12cacb0..f53377a 100644 --- a/app/modules/cafe24/router.py +++ b/app/modules/cafe24/router.py @@ -10,7 +10,6 @@ 라우트가 많아 기능별 파일로 나눈다(다른 모듈의 단일 router.py 패턴을 규모 때문에 확장한 것). 여기서는 루트 라우터를 만들고 서브 라우터를 결합한다. routes_products 상품 목록/검색 · 상세설명 조회·편집·적용 - routes_bulk 일괄수정 (검사 → 선택 적용) routes_schedules 예약 등록·목록·취소 (실행은 worker.py) routes_system 연결(OAuth)·상태·API 로그·작업 로그 """ @@ -21,7 +20,6 @@ import logging from fastapi import APIRouter -from .routes_bulk import bulk_router from .routes_products import products_router from .routes_schedules import schedules_router from .routes_system import system_router @@ -31,7 +29,6 @@ logger = logging.getLogger("cafe24.router") router = APIRouter(prefix="/cafe24", tags=["cafe24"]) router.include_router(products_router) -router.include_router(bulk_router) router.include_router(schedules_router) router.include_router(system_router) diff --git a/app/modules/cafe24/routes_bulk.py b/app/modules/cafe24/routes_bulk.py deleted file mode 100644 index 95a91bd..0000000 --- a/app/modules/cafe24/routes_bulk.py +++ /dev/null @@ -1,195 +0,0 @@ -"""카페24 일괄수정 — 상세페이지 맨 위 `" - - -def _preview(html: str) -> dict[str, Any]: - """현재 ", re.IGNORECASE | re.DOTALL) - - -def find_style_blocks(html: str) -> list[str]: - """상세설명 안의 블록 전체(원문 그대로).""" - return _STYLE_BLOCK_RE.findall(html or "") - - -def replace_first_style_block(html: str, new_block: str) -> str: - """맨 앞 " - - -def test_find_style_blocks(): - html = "
'
- out = store.replace_first_style_block(html, _NEW_STYLE)
- assert "비디오" not in out
- assert '
' in out
-
-
-def test_fingerprint_detects_change():
- a = store.fingerprint("A
") - assert a == store.fingerprint("A
") - assert a != store.fingerprint("B
") - assert len(a) == 32 - - # ════════════════════════════════════════════════════════════ # 예약 — 입력 검증 # ════════════════════════════════════════════════════════════ @@ -628,10 +569,14 @@ def test_parse_schedule_at_rejects_past_and_garbage(): def test_parse_schedule_at_allows_one_minute_grace(): - """폼을 채우는 동안 시간이 흐른 경우를 거부하지 않는다.""" - base = now_kst() - just_now = (base - timedelta(seconds=30)).strftime("%Y-%m-%dT%H:%M") - assert store.parse_schedule_at(just_now, now=base) is not None + """`datetime-local` 은 초를 버린다 — 지금 이 분(分)을 고른 것을 거부하면 안 된다. + + now 의 초를 고정해 실행 시각에 따라 결과가 달라지지 않게 한다(예전에 이 테스트가 + 초에 따라 실패했다). + """ + base = now_kst().replace(second=40, microsecond=0) + this_minute = base.strftime("%Y-%m-%dT%H:%M") # 초가 잘려 base 보다 40초 과거 + assert store.parse_schedule_at(this_minute, now=base) is not None def test_describe_schedule_action(): diff --git a/docs/CAFE24_MODULE.md b/docs/CAFE24_MODULE.md index 2b56a7f..59f4f6a 100644 --- a/docs/CAFE24_MODULE.md +++ b/docs/CAFE24_MODULE.md @@ -26,7 +26,6 @@ app/integrations/cafe24/ ← 공통 (상품관리 + 향후 주문관리 app/modules/cafe24/ ← 상품관리 모듈 ├─ router.py 루트 라우터(prefix=/cafe24) + 서브 라우터 결합 ├─ routes_products.py 2분할 화면 · 편집기 조각 · 적용(쓰기) -├─ routes_bulk.py 일괄수정 (검사 → 선택 적용) ├─ routes_schedules.py 예약 등록·목록·취소 ├─ worker.py 예약 실행기 (compose 서비스 dbx-cafe24-worker) ├─ routes_system.py 연결(OAuth)·상태·API 로그·작업 로그 @@ -35,7 +34,7 @@ app/modules/cafe24/ ← 상품관리 모듈 ├─ store.py 순수 로직 — 상수·상태전이·재시도 규칙·검증 ├─ tests/ DB/네트워크 없는 유닛테스트 └─ templates/cafe24/ _nav.html · products.html(2분할) · - _editor.html(오른쪽 조각) · bulk.html · + _editor.html(오른쪽 조각) · schedules.html · system.html ``` @@ -56,9 +55,6 @@ app/modules/cafe24/ ← 상품관리 모듈 | `GET /cafe24/products/{product_no}/pane` | 오른쪽 편집기 조각 (JS 가 가져감) | `cafe24` | | `GET /cafe24/products/{product_no}` | → `/cafe24/?selected=` 로 리다이렉트(옛 주소) | `cafe24` | | `POST /cafe24/products/{product_no}/apply` | 편집한 HTML 을 카페24에 즉시 적용 | `cafe24` | -| `GET /cafe24/bulk` | 일괄수정 화면 (`