add contacts rourtes
This commit is contained in:
@@ -635,6 +635,34 @@ ALTER TABLE ONLY office_users
|
|||||||
|
|
||||||
ALTER TABLE office_users OWNER TO merms_panel;
|
ALTER TABLE office_users OWNER TO merms_panel;
|
||||||
|
|
||||||
|
CREATE TABLE products_contacts(
|
||||||
|
id SERIAL,
|
||||||
|
uid uuid DEFAULT uuid_generate_v4(),
|
||||||
|
username VARCHAR(25) UNIQUE NOT NULL,
|
||||||
|
product_id VARCHAR(25) NOT NULL,
|
||||||
|
subscription_uid VARCHAR(100) NOT NULL,
|
||||||
|
title VARCHAR(100) NOT NULL,
|
||||||
|
sender VARCHAR(120) NOT NULL,
|
||||||
|
message TEXT,
|
||||||
|
status INT DEFAULT 0,
|
||||||
|
added timestamp without time zone DEFAULT now()
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE ONLY products_contacts
|
||||||
|
ADD CONSTRAINT products_contacts_id_key UNIQUE (id);
|
||||||
|
|
||||||
|
ALTER TABLE products_contacts OWNER TO merms_panel;
|
||||||
|
|
||||||
|
|
||||||
|
new_l = {
|
||||||
|
"uid": "425611f2-c692-4404-b93d-76ca7a5ce7" + str(x),
|
||||||
|
"title": "Contact Random Item on " + str(x),
|
||||||
|
"category": cat_list[random.randint(0, 3)],
|
||||||
|
"added": calDate,
|
||||||
|
"sender": "Firstname Lastname" + str(random.randint(1, 4)),
|
||||||
|
"message": dummy_message()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -468,6 +468,14 @@ def get_web_contents():
|
|||||||
result = WebContentsService.get_web_contents_data(provision_uid)
|
result = WebContentsService.get_web_contents_data(provision_uid)
|
||||||
return jsonify(result)
|
return jsonify(result)
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
@api.route('/web/contacts', methods=['POST'])
|
||||||
|
# @token_required
|
||||||
|
def get_web_receive_contacts():
|
||||||
|
# Call the dashboard service
|
||||||
|
data = request.get_json()
|
||||||
|
result = ContactService.process_save_contacts(data)
|
||||||
|
return jsonify(result)
|
||||||
|
|
||||||
# =====================================================
|
# =====================================================
|
||||||
@api.route('/web/generatives', methods=['GET'])
|
@api.route('/web/generatives', methods=['GET'])
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class ContactService(BaseService):
|
|||||||
"category": cat_list[random.randint(0, 3)],
|
"category": cat_list[random.randint(0, 3)],
|
||||||
"added": calDate,
|
"added": calDate,
|
||||||
"sender": "Firstname Lastname" + str(random.randint(1, 4)),
|
"sender": "Firstname Lastname" + str(random.randint(1, 4)),
|
||||||
"message": dummy_message()
|
"message": ContactService.dummy_message()
|
||||||
}
|
}
|
||||||
dList.append(new_l)
|
dList.append(new_l)
|
||||||
|
|
||||||
@@ -87,6 +87,7 @@ class ContactService(BaseService):
|
|||||||
return ResponseHelper.internal_server_error()
|
return ResponseHelper.internal_server_error()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def dummy_message():
|
def dummy_message():
|
||||||
dmm = "Dmummy Message" + str(random.randint(100, 400))
|
dmm = "Dmummy Message" + str(random.randint(100, 400))
|
||||||
mss = f"""
|
mss = f"""
|
||||||
@@ -97,3 +98,8 @@ def dummy_message():
|
|||||||
We know this in our gut, but what can we do about it? How can we motivate ourselves? One of the most difficult aspects of achieving success is staying motivated over the long haul.
|
We know this in our gut, but what can we do about it? How can we motivate ourselves? One of the most difficult aspects of achieving success is staying motivated over the long haul.
|
||||||
"""
|
"""
|
||||||
return mss
|
return mss
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def process_save_contacts(data):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -510,41 +510,19 @@ class MyProductsService(BaseService):
|
|||||||
settings_items = {}
|
settings_items = {}
|
||||||
if product_id == "A000001":
|
if product_id == "A000001":
|
||||||
settings_items = {
|
settings_items = {
|
||||||
|
"url_config_tab": {"title": 'URL Configuration', "controls": 'url-config', "active": '',
|
||||||
|
"custom": True, "data": {}, "list_order": 0},
|
||||||
"settings": {"title": 'Settings', "controls": 'settings', "active": 'active show',
|
"settings": {"title": 'Settings', "controls": 'settings', "active": 'active show',
|
||||||
"custom": False, "data": settingsFields, "list_order": 0},
|
"custom": False, "data": settingsFields, "list_order": 1},
|
||||||
"home_tab": {"title": 'Home Page', "controls": 'home', "active": '', "custom": False,
|
"home_tab": {"title": 'Home Page', "controls": 'home', "active": '', "custom": False,
|
||||||
"data": homeFields, "list_order": 1},
|
"data": homeFields, "list_order": 2},
|
||||||
"footer_tab": {"title": 'Footer', "controls": 'footer', "active": '', "custom": False,
|
"footer_tab": {"title": 'Footer', "controls": 'footer', "active": '', "custom": False,
|
||||||
"data": footerFields, "list_order": 2},
|
"data": footerFields, "list_order": 3},
|
||||||
"about_tab": {"title": 'About Page', "controls": 'about', "active": '', "custom": False,
|
"about_tab": {"title": 'About Page', "controls": 'about', "active": '', "custom": False,
|
||||||
"data": aboutFields, "list_order": 3},
|
"data": aboutFields, "list_order": 4},
|
||||||
"contact_tab": {"title": 'Contact Page', "controls": 'contact', "active": '',
|
"contact_tab": {"title": 'Contact Page', "controls": 'contact', "active": '',
|
||||||
"custom": False,
|
"custom": False,
|
||||||
"data": contactFields, "list_order": 4},
|
"data": contactFields, "list_order": 5},
|
||||||
"social_tab": {"title": 'Socials', "controls": 'social', "active": '', "custom": False,
|
|
||||||
"data": socialFields, "list_order": 5},
|
|
||||||
"template_tab": {"title": 'Template', "controls": 'template', "active": '', "custom": True,
|
|
||||||
"data": templateData, "list_order": 6},
|
|
||||||
"color_scheme_tab": {"title": 'Color Scheme', "controls": 'color-scheme', "active": '',
|
|
||||||
"custom": True, "data": {}, "list_order": 7}
|
|
||||||
}
|
|
||||||
|
|
||||||
if product_id == "A000002":
|
|
||||||
settings_items = {
|
|
||||||
"settings": {"title": 'Settings', "controls": 'settings', "active": 'active show',
|
|
||||||
"custom": False, "data": settingsFields, "list_order": 0},
|
|
||||||
"home_tab": {"title": 'Home Page', "controls": 'home', "active": '', "custom": False,
|
|
||||||
"data": homeFields, "list_order": 1},
|
|
||||||
"footer_tab": {"title": 'Footer', "controls": 'footer', "active": '', "custom": False,
|
|
||||||
"data": footerFields, "list_order": 2},
|
|
||||||
"about_tab": {"title": 'About Page', "controls": 'about', "active": '', "custom": False,
|
|
||||||
"data": aboutFields, "list_order": 3},
|
|
||||||
"contact_tab": {"title": 'Contact Page', "controls": 'contact', "active": '',
|
|
||||||
"custom": False,
|
|
||||||
"data": contactFields, "list_order": 4},
|
|
||||||
"testimonial_tab": {"title": 'Testimonials', "controls": 'testimonial', "active": '',
|
|
||||||
"custom": False,
|
|
||||||
"data": testimonialFields, "list_order": 5},
|
|
||||||
"social_tab": {"title": 'Socials', "controls": 'social', "active": '', "custom": False,
|
"social_tab": {"title": 'Socials', "controls": 'social', "active": '', "custom": False,
|
||||||
"data": socialFields, "list_order": 6},
|
"data": socialFields, "list_order": 6},
|
||||||
"template_tab": {"title": 'Template', "controls": 'template', "active": '', "custom": True,
|
"template_tab": {"title": 'Template', "controls": 'template', "active": '', "custom": True,
|
||||||
@@ -552,6 +530,32 @@ class MyProductsService(BaseService):
|
|||||||
"color_scheme_tab": {"title": 'Color Scheme', "controls": 'color-scheme', "active": '',
|
"color_scheme_tab": {"title": 'Color Scheme', "controls": 'color-scheme', "active": '',
|
||||||
"custom": True, "data": {}, "list_order": 8}
|
"custom": True, "data": {}, "list_order": 8}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if product_id == "A000002":
|
||||||
|
settings_items = {
|
||||||
|
"url_config_tab": {"title": 'URL Configuration', "controls": 'url-config', "active": '',
|
||||||
|
"custom": True, "data": {}, "list_order": 0},
|
||||||
|
"settings": {"title": 'Settings', "controls": 'settings', "active": 'active show',
|
||||||
|
"custom": False, "data": settingsFields, "list_order": 1},
|
||||||
|
"home_tab": {"title": 'Home Page', "controls": 'home', "active": '', "custom": False,
|
||||||
|
"data": homeFields, "list_order": 2},
|
||||||
|
"footer_tab": {"title": 'Footer', "controls": 'footer', "active": '', "custom": False,
|
||||||
|
"data": footerFields, "list_order": 3},
|
||||||
|
"about_tab": {"title": 'About Page', "controls": 'about', "active": '', "custom": False,
|
||||||
|
"data": aboutFields, "list_order": 4},
|
||||||
|
"contact_tab": {"title": 'Contact Page', "controls": 'contact', "active": '',
|
||||||
|
"custom": False,
|
||||||
|
"data": contactFields, "list_order": 5},
|
||||||
|
"testimonial_tab": {"title": 'Testimonials', "controls": 'testimonial', "active": '',
|
||||||
|
"custom": False,
|
||||||
|
"data": testimonialFields, "list_order": 6},
|
||||||
|
"social_tab": {"title": 'Socials', "controls": 'social', "active": '', "custom": False,
|
||||||
|
"data": socialFields, "list_order": 7},
|
||||||
|
"template_tab": {"title": 'Template', "controls": 'template', "active": '', "custom": True,
|
||||||
|
"data": templateData, "list_order": 8},
|
||||||
|
"color_scheme_tab": {"title": 'Color Scheme', "controls": 'color-scheme', "active": '',
|
||||||
|
"custom": True, "data": {}, "list_order": 8}
|
||||||
|
}
|
||||||
#
|
#
|
||||||
|
|
||||||
# Simulate processing
|
# Simulate processing
|
||||||
|
|||||||
Reference in New Issue
Block a user