From 30d95c8579aa3a14f5e7f494d5796571a78a32d5 Mon Sep 17 00:00:00 2001 From: thug0bin Date: Wed, 4 Mar 2026 00:55:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A0=9C=ED=92=88=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=ED=81=AC=EB=A1=A4=EB=A7=81=EC=97=90=20=EB=82=A0?= =?UTF-8?q?=EC=A7=9C=20=EC=84=A0=ED=83=9D=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20-=20=EB=8B=AC=EB=A0=A5=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=82=A0=EC=A7=9C=20=EC=84=A0=ED=83=9D=20=EA=B0=80=EB=8A=A5=20?= =?UTF-8?q?-=20=ED=95=B4=EB=8B=B9=20=EB=82=A0=EC=A7=9C=20=ED=8C=90?= =?UTF-8?q?=EB=A7=A4=20=EC=A0=9C=ED=92=88=20=ED=81=AC=EB=A1=A4=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app.py | 10 +++-- backend/templates/admin_product_images.html | 28 ++++++++++--- backend/utils/yakkok_crawler.py | 45 ++++++++++++++++----- 3 files changed, 62 insertions(+), 21 deletions(-) diff --git a/backend/app.py b/backend/app.py index 4bac9ef..4837549 100644 --- a/backend/app.py +++ b/backend/app.py @@ -5767,11 +5767,13 @@ def api_product_image_detail(barcode): @app.route('/api/admin/product-images/crawl-today', methods=['POST']) def api_crawl_today(): - """오늘 판매 제품 크롤링""" + """특정 날짜 판매 제품 크롤링 (date 파라미터 없으면 오늘)""" try: - from utils.yakkok_crawler import crawl_today_sales - result = crawl_today_sales(headless=True) - return jsonify({'success': True, 'result': result}) + from utils.yakkok_crawler import crawl_sales_by_date + data = request.get_json() or {} + date_str = data.get('date') # YYYY-MM-DD 형식 + result = crawl_sales_by_date(date_str, headless=True) + return jsonify({'success': True, 'result': result, 'date': date_str or 'today'}) except Exception as e: logging.error(f"크롤링 오류: {e}") return jsonify({'success': False, 'error': str(e)}), 500 diff --git a/backend/templates/admin_product_images.html b/backend/templates/admin_product_images.html index 312e3e8..b4875ea 100644 --- a/backend/templates/admin_product_images.html +++ b/backend/templates/admin_product_images.html @@ -325,8 +325,9 @@

🖼️ 제품 이미지 관리

-