diff --git a/backend/geoyoung_api.py b/backend/geoyoung_api.py index 93f2be4..d0dccec 100644 --- a/backend/geoyoung_api.py +++ b/backend/geoyoung_api.py @@ -478,6 +478,128 @@ def api_get_monthly_sales(): }), 501 +# ========== 주문 조회 API ========== + +@geoyoung_bp.route('/order-list', methods=['GET']) +def api_geoyoung_order_list(): + """ + 지오영 주문 목록 조회 API + + GET /api/geoyoung/order-list?start_date=2026-03-01&end_date=2026-03-07 + + Query Parameters: + start_date: 시작일 (YYYY-MM-DD), 기본값 30일 전 + end_date: 종료일 (YYYY-MM-DD), 기본값 오늘 + + Returns: + { + "success": true, + "orders": [{ + "order_num": "DA2603-0006409", + "order_date": "2026-03-07", + "order_time": "09:08:55", + "total_amount": 132020, + "item_count": 3, + "status": "출고확정" + }, ...], + "total_count": 5, + "start_date": "2026-03-01", + "end_date": "2026-03-07" + } + """ + start_date = request.args.get('start_date', '').strip() + end_date = request.args.get('end_date', '').strip() + + try: + session = get_geo_session() + result = session.get_order_list(start_date or None, end_date or None) + return jsonify(result) + except Exception as e: + logger.error(f"지오영 주문 목록 조회 오류: {e}") + return jsonify({ + 'success': False, + 'error': 'API_ERROR', + 'message': str(e), + 'orders': [], + 'total_count': 0 + }), 500 + + +@geoyoung_bp.route('/order-detail/', methods=['GET']) +def api_geoyoung_order_detail(order_num): + """ + 지오영 주문 상세 조회 API + + GET /api/geoyoung/order-detail/DA2603-0006409 + + Returns: + { + "success": true, + "order_num": "DA2603-0006409", + "order_date": "2026-03-07", + "order_time": "09:08:55", + "items": [{ + "product_code": "008709", + "kd_code": "670400830", + "product_name": "레바미피드정100mg", + "spec": "100mg", + "quantity": 10, + "unit_price": 500, + "amount": 5000 + }, ...], + "total_amount": 132020, + "item_count": 3 + } + """ + try: + session = get_geo_session() + result = session.get_order_detail(order_num) + return jsonify(result) + except Exception as e: + logger.error(f"지오영 주문 상세 조회 오류: {e}") + return jsonify({ + 'success': False, + 'error': 'API_ERROR', + 'message': str(e), + 'order_num': order_num, + 'items': [], + 'total_amount': 0 + }), 500 + + +@geoyoung_bp.route('/order-today', methods=['GET']) +def api_geoyoung_order_today(): + """ + 지오영 오늘 주문 요약 API + + GET /api/geoyoung/order-today + + Returns: + { + "success": true, + "date": "2026-03-07", + "order_count": 3, + "total_amount": 450000, + "item_count": 15, + "orders": [...] + } + """ + try: + session = get_geo_session() + result = session.get_today_order_summary() + return jsonify(result) + except Exception as e: + logger.error(f"지오영 오늘 주문 조회 오류: {e}") + return jsonify({ + 'success': False, + 'error': 'API_ERROR', + 'message': str(e), + 'date': '', + 'order_count': 0, + 'total_amount': 0 + }), 500 + + # ========== 하위 호환성 ========== # 기존 코드에서 직접 클래스 참조하는 경우를 위해 diff --git a/backend/static/uploads/pets/pet_5_f89b9542.jpg b/backend/static/uploads/pets/pet_5_f89b9542.jpg new file mode 100644 index 0000000..95e5a8b Binary files /dev/null and b/backend/static/uploads/pets/pet_5_f89b9542.jpg differ diff --git a/backend/static/uploads/pets/pet_6_0f0409cd.jpeg b/backend/static/uploads/pets/pet_6_0f0409cd.jpeg new file mode 100644 index 0000000..00bb372 Binary files /dev/null and b/backend/static/uploads/pets/pet_6_0f0409cd.jpeg differ diff --git a/backend/static/uploads/pets/pet_7_fc95b8e7.jpeg b/backend/static/uploads/pets/pet_7_fc95b8e7.jpeg new file mode 100644 index 0000000..477e85f Binary files /dev/null and b/backend/static/uploads/pets/pet_7_fc95b8e7.jpeg differ diff --git a/backend/static/uploads/pets/pet_8_48666e98.jpeg b/backend/static/uploads/pets/pet_8_48666e98.jpeg new file mode 100644 index 0000000..eda7a9c Binary files /dev/null and b/backend/static/uploads/pets/pet_8_48666e98.jpeg differ