Files
MermsCoreFlask/app/api/services/web_contents.py
2025-08-10 19:57:01 -04:00

53 lines
3.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from flask import jsonify
from app.api.services import MyProductsService
from app.utils.logger import logger
from app.api.services.base_service import BaseService
from sqlalchemy import func, desc
from app.extensions import db
from app.models import MembersProductsSettings
class WebContentsService(BaseService):
@staticmethod
def get_web_contents_data(provision_uid):
try:
web_contents_data = {
"site_title": "my-site-title",
"site_description": "This is site description in the header",
"site_logo_text": "MY-GOOD-LOGO",
"site_contact_email": "email@specialemail.com",
"site_contact_phone": "911 111 1111",
"site_keywords": "Responsive, HTML5, DSAThemes, Landing, Software, Mobile App, SaaS, Startup, Creative, Digital Product",
"facebook": "myface.facebook.com",
"twitter": "mytwit.twitter.com",
"youtube": "myyou.youtube.com",
"banner_text": "This is the main business text on the web page",
"banner_description": "Naira",
"footer_description": "Any text under the logo on the footer",
"about_description": "Naira",
"banner_text": "AMEYE01 marketing that drives results for your business",
"banner_description": "Mauris donec ociis magnis sapien ipsum sagittis sapien tempor and volute gravida aliquet quaerat vitae",
"about_title": "This is about title section",
"about_description": "About Description - Mauris donec ociis magnis sapien ipsum sagittis sapien tempor and volute gravida aliquet quaerat vitae",
"about_extra_1": "About Extra 1 - Mauris donec ociis magnis sapien ipsum sagittis sapien tempor and volute gravida aliquet quaerat vitae",
"about_extra_2": "About - Extra 2 -Mauris donec ociis magnis sapien ipsum sagittis sapien tempor and volute gravida aliquet quaerat vitae ",
"contact_title": "Questions? Let's Talk",
"contact_introduction": "Want to learn more about us, or speak with an expert? Let us know what you are looking for and well get back to you right away",
}
# web_contents_data ={}
settings_data_result = MembersProductsSettings.get_product_settings_by_subscription_uid(provision_uid)
if settings_data_result:
for t in settings_data_result:
if t.settings_key.strip() is web_contents_data:
web_contents_data[t.settings_key.strip()] = t.setting_value.strip()
else:
web_contents_data[t.settings_key.strip()] = t.setting_value.strip()
return web_contents_data
except Exception as e:
logger.error(f"An error occurred while getting dashboard data: {str(e)}", exc_info=True)
return jsonify({"message": "Internal Server Error"}), 500