feat: 지오영 cart/cancel, cart/restore 엔드포인트 추가
- POST /api/geoyoung/cart/cancel - 개별 삭제 - POST /api/geoyoung/cart/restore - NOT_SUPPORTED 응답
This commit is contained in:
parent
c1596a6d35
commit
ba38c05b93
@ -171,6 +171,53 @@ def api_geoyoung_cart_clear():
|
|||||||
return jsonify({'success': False, 'error': str(e)}), 500
|
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'])
|
@geoyoung_bp.route('/confirm', methods=['POST'])
|
||||||
def api_geoyoung_confirm():
|
def api_geoyoung_confirm():
|
||||||
"""주문 확정 API"""
|
"""주문 확정 API"""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user