diff --git a/app/api/routes/routes.py b/app/api/routes/routes.py index 19307c6..2d13288 100644 --- a/app/api/routes/routes.py +++ b/app/api/routes/routes.py @@ -4,18 +4,11 @@ from app.api.services import ( RegisterService, AccountService, ProductsService, - EligibilityCheckService, - SelectOfferService, - ProvideLoanService, - LoanStatusService, - RepaymentService, - CustomerConsentService, - NotificationCallbackService, AuthorizationService, MyProductsService, ContactService, OfficeAuthService, - OfficeDashboardService + OfficeDashboardService, WebContentsService ) from app.utils.logger import logger from app.api.middlewares import enforce_json, require_auth @@ -199,7 +192,7 @@ def mycalendar_dash(): def test_check(): data = {"uid": "ok", "token":"jjjfjfjfjfjjf"} - logger.info(f"Member Actions Error: {action_data}") + logger.info(f"Member Actions Error: {data}") response = AccountService.process_action_request(data) #response = ProductsService.process_request(data) return {"status": "ok"}, 200 @@ -244,7 +237,14 @@ def get_subscription_office(): #===================================================== +@api.route('/web/contents', methods=['GET']) +# @token_required +def get_web_contents(): + # Call the dashboard service + result = WebContentsService.get_web_contents_data() + return jsonify(result) +#=================================================== # # EligibilityCheck Endpoint # @api.route("/EligibilityCheck", methods=["POST"]) # @jwt_required() diff --git a/app/api/services/__init__.py b/app/api/services/__init__.py index 40753c5..92856b3 100644 --- a/app/api/services/__init__.py +++ b/app/api/services/__init__.py @@ -15,4 +15,5 @@ from app.api.services.myproduct import MyProductsService from app.api.services.contacts import ContactService from app.api.services.office_auth import OfficeAuthService from app.api.services.office_dashboard import OfficeDashboardService +from app.api.services.web_contents import WebContentsService diff --git a/app/api/services/web_contents.py b/app/api/services/web_contents.py new file mode 100644 index 0000000..63d19c8 --- /dev/null +++ b/app/api/services/web_contents.py @@ -0,0 +1,33 @@ +from flask import jsonify +from app.utils.logger import logger +from app.api.services.base_service import BaseService +from sqlalchemy import func, desc +from app.extensions import db + + +class WebContentsService(BaseService): + + @staticmethod + def get_web_contents_data(): + try: + + web_contents_data = { + "site_title": "good-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", + "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 loogo on the footer", + "about_description": "Naira" + } + + 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