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 @@

🖼️ 제품 이미지 관리

-