From ba38c05b93fb9a53d2a8bd6546c05ec72ea47d72 Mon Sep 17 00:00:00 2001 From: thug0bin Date: Fri, 6 Mar 2026 11:56:17 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A7=80=EC=98=A4=EC=98=81=20cart/canc?= =?UTF-8?q?el,=20cart/restore=20=EC=97=94=EB=93=9C=ED=8F=AC=EC=9D=B8?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - POST /api/geoyoung/cart/cancel - 개별 삭제 - POST /api/geoyoung/cart/restore - NOT_SUPPORTED 응답 --- backend/geoyoung_api.py | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/backend/geoyoung_api.py b/backend/geoyoung_api.py index 5b41c63..1084555 100644 --- a/backend/geoyoung_api.py +++ b/backend/geoyoung_api.py @@ -171,6 +171,53 @@ def api_geoyoung_cart_clear(): return jsonify({'success': False, 'error': str(e)}), 500 +@geoyoung_bp.route('/cart/cancel', methods=['POST']) +def api_geoyoung_cart_cancel(): + """ + 장바구니 개별 항목 삭제 API (Hard delete) + + POST /api/geoyoung/cart/cancel + { + "row_index": 0, // 또는 + "product_code": "008709" + } + + ⚠️ 지오영은 완전 삭제됨 (복원 불가, 다시 추가해야 함) + """ + data = request.get_json() or {} + row_index = data.get('row_index') + product_code = data.get('product_code') + + if row_index is None and not product_code: + return jsonify({ + 'success': False, + 'error': 'MISSING_PARAM', + 'message': 'row_index 또는 product_code 필요' + }), 400 + + try: + session = get_geo_session() + result = session.cancel_item(row_index=row_index, product_code=product_code) + return jsonify(result) + except Exception as e: + return jsonify({'success': False, 'error': str(e)}), 500 + + +@geoyoung_bp.route('/cart/restore', methods=['POST']) +def api_geoyoung_cart_restore(): + """ + 삭제된 항목 복원 API - 지오영은 Hard delete이므로 지원 안 함 + + Returns: + 항상 {'success': False, 'error': 'NOT_SUPPORTED'} + """ + return jsonify({ + 'success': False, + 'error': 'NOT_SUPPORTED', + 'message': '지오영은 삭제 후 복원 불가 (다시 추가 필요)' + }), 400 + + @geoyoung_bp.route('/confirm', methods=['POST']) def api_geoyoung_confirm(): """주문 확정 API"""