diff --git a/app/__pycache__/routes.cpython-313.pyc b/app/__pycache__/routes.cpython-313.pyc index 31b4e37..d9f08fd 100644 Binary files a/app/__pycache__/routes.cpython-313.pyc and b/app/__pycache__/routes.cpython-313.pyc differ diff --git a/app/routes.py b/app/routes.py index 5a7afae..8e7ca50 100644 --- a/app/routes.py +++ b/app/routes.py @@ -52,6 +52,28 @@ def new_order(): return jsonify({"status": "ok"}), 200 +@main.route("/sku", methods=["POST"]) +def sku(): + if not request.is_json: + return jsonify({"error": "Invalid content type"}), 400 + + data = request.get_json() + print(data) + order_id = data.get("orderId") + if order_id is None: + return jsonify({"error": "orderId is required"}), 400 + + if not isinstance(order_id, int): + return jsonify({"error": "orderId must be int"}), 400 + + # TODO: обработка заказа + print(f"New order received: {order_id}") + # logging.warn(get_order_content(order_id)) + logging.warn(f"NEWsku: {order_id}") + + return jsonify({"status": "ok"}), 200 + + @main.route("/product") def product_update(): # получаем параметры diff --git a/services/__pycache__/__init__.cpython-313.pyc b/services/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..d4fdb02 Binary files /dev/null and b/services/__pycache__/__init__.cpython-313.pyc differ