diff --git a/services/web/project/__init__.py b/services/web/project/__init__.py index abe59a2..fd1f04c 100644 --- a/services/web/project/__init__.py +++ b/services/web/project/__init__.py @@ -741,30 +741,36 @@ def myproduct(current_user): }, 400 print(product_id) -# FIND_PRODUCT= "SELECT uid,product_id,name,description,banner,status FROM products WHERE product_id='"+product_id+"'" -# with connection: -# with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor: -# cursor.execute(FIND_PRODUCT) -# product = cursor.fetchall() -# print(product[0]["uid"]) + member_id = current_user['user']['member_id'] + myproduct_data = myproduct_detail(member_id , product_id) + return jsonify(myproduct_data=myproduct_data) +@app.route("/panel/myproduct/provision") +@token_required +def myproduct_provision(current_user): + product_id = request.args.get('product_id') + print(product_id) + if not product_id: + return { + "message": "Please provide product_id", + "data": None, + "error": "Bad request" + }, 400 + + print(product_id) member_id = current_user['user']['member_id'] myproduct_data = myproduct_detail(member_id , product_id) -# myproduct_data = { -# "myproduct_uid":"", -# "status": product[0]["status"], -# "product_id": product[0]["product_id"], -# "product_uid": product[0]["uid"], -# "banner": product[0]["banner"], -# "product_name": product[0]["name"], -# "description": "Product Description - Commitment is something that comes from understanding that everything has its price and then having the willingness to pay that price. This is important because nobody wants to put significant effort into something, only to find out after the fact that the price was too high.The price is something not necessarily defined as financial. It could be time, effort, sacrifice, money or perhaps, something else.", -# "title": product[0]["description"], -# "subscription_text" : "Start with your goals in mind and then work possible.ith yand Goals. If the plan doesn’t support the vision then change it!", -# "promotion_text": "Start Free Today !", -# "price_text" : "90 days free and 3.95/Month", -# } - return jsonify(myproduct_data=myproduct_data) + provision = { + "last_update": datetime.datetime.utcnow(), + "percent_completed" : random.randint(10, 99), + "url": [ + {"id": "3", "action": "Verifying your product..." , "date": "10-10-2010 11:00 AM"}, + {"id": "2", "action": "URL assigned - Progress on the URL " , "date": "10-10-2010 11:30 AM"}, + {"id": "1", "action": "Initiating product creation" , "date": "10-12-2010 11:30 AM"}, + ] + } + return jsonify(provision=provision,myproduct_data=myproduct_data) @app.route("/panel/myproduct/subscription", methods=["POST"]) @token_required