fix cile
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
from marshmallow import Schema, fields
|
||||||
|
|
||||||
|
class MyProductSchema(Schema):
|
||||||
|
token = fields.Str(required=True)
|
||||||
|
uid = fields.Str(required=True)
|
||||||
|
product_id = fields.Str(required=True)
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ from app.api.helpers.response_helper import ResponseHelper
|
|||||||
from werkzeug.security import generate_password_hash, check_password_hash
|
from werkzeug.security import generate_password_hash, check_password_hash
|
||||||
# from app.api.schemas.register import RegisterSchema
|
# from app.api.schemas.register import RegisterSchema
|
||||||
from app.api.schemas.products import ProductsSchema
|
from app.api.schemas.products import ProductsSchema
|
||||||
from app.api.schemas.user import UserSchema
|
from app.api.schemas.myproduct import MyProductSchema
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import jwt
|
import jwt
|
||||||
@@ -29,49 +29,33 @@ class MyProductsService(BaseService):
|
|||||||
try:
|
try:
|
||||||
with db.session.begin():
|
with db.session.begin():
|
||||||
|
|
||||||
validated_data = MyProductsService.validate_data(data, UserSchema())
|
validated_data = MyProductsService.validate_data(data, MyProductSchema())
|
||||||
token = validated_data.get('token')
|
token = validated_data.get('token')
|
||||||
uid = validated_data.get('uid')
|
uid = validated_data.get('uid')
|
||||||
|
product_id = validated_data.get('product_id')
|
||||||
|
|
||||||
# product_id = request.args.get('product_id')
|
myproduct_data = {
|
||||||
# print(product_id)
|
"myproudct": {
|
||||||
# if not product_id:
|
"banner": "banner.jpg",
|
||||||
# return {
|
"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.",
|
||||||
# "message": "Please provide product_id",
|
"internal_url": "",
|
||||||
# "data": None,
|
"price_text": "90 days free and 3.95/Month",
|
||||||
# "error": "Bad request"
|
"product_id": "A000001",
|
||||||
# }, 400
|
"product_name": "Personal Website",
|
||||||
#
|
"product_subscription_uid": "",
|
||||||
# print(product_id)
|
"product_uid": "77b479d2-48c6-491a-8c05-b5debf1557a3",
|
||||||
# member_id = current_user['user']['member_id']
|
"promotion_text": "Start Free Today !",
|
||||||
# myproduct_data = myproduct_detail(member_id, product_id)
|
"status": 1,
|
||||||
|
"subscription_text": "Start with your goals in mind and then work possible.ith yand Goals. If the plan doesn\u2019t support the vision then change it!",
|
||||||
|
"title": "Your personal professional web presence"
|
||||||
member_id = 1 # current_user["user"]["id"]
|
}
|
||||||
products = Products.get_user_product_list(member_id)
|
}
|
||||||
product_data=[]
|
|
||||||
logger.info(f"Product Data ****** *****: {products}")
|
|
||||||
|
|
||||||
for t in products:
|
|
||||||
product_data.append({
|
|
||||||
'id': t.id,
|
|
||||||
'uid': t.uid,
|
|
||||||
'product_id': t.product_id,
|
|
||||||
'description': t.description,
|
|
||||||
'name': t.name,
|
|
||||||
'status': t.status,
|
|
||||||
'added': t.added.isoformat() if t.added else None,
|
|
||||||
'updated': t.updated.isoformat() if t.updated else None,
|
|
||||||
'banner': t.banner,
|
|
||||||
'prov_status': '',
|
|
||||||
'status_text': 'Activate Now'
|
|
||||||
})
|
|
||||||
|
|
||||||
# Simulate processing
|
# Simulate processing
|
||||||
response_data = {
|
response_data = {
|
||||||
"products_data": product_data,
|
"myproduct": myproduct_data,
|
||||||
"member_id": 0,
|
"member_id": 1,
|
||||||
"uid": 0,
|
"uid": uid,
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResponseHelper.success(data=response_data)
|
return ResponseHelper.success(data=response_data)
|
||||||
|
|||||||
Reference in New Issue
Block a user