some updates
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
from flask import Blueprint, request, jsonify, current_app
|
||||
import requests
|
||||
from app.utils.auth import get_headers
|
||||
from app.config import settings
|
||||
|
||||
auth_bp = Blueprint("auth", __name__)
|
||||
|
||||
AUTH_BASE_URL = settings.SIMBRELLA_AUTH_BASE_URL
|
||||
BASE_URL = settings.SIMBRELLA_BASE_URL
|
||||
|
||||
|
||||
@auth_bp.route("/health", methods=["GET"])
|
||||
def health():
|
||||
@@ -13,7 +17,7 @@ def health():
|
||||
@auth_bp.route("/login", methods=["POST"])
|
||||
def login():
|
||||
data = request.json
|
||||
api_url = "https://coreapi.dev.simbrellang.net/api/auth/login"
|
||||
api_url = f"{AUTH_BASE_URL}/login"
|
||||
|
||||
response = requests.post(api_url, json=data)
|
||||
if response.status_code == 200:
|
||||
@@ -24,7 +28,7 @@ def login():
|
||||
@auth_bp.route("/status-call", methods=["POST"])
|
||||
def status_call():
|
||||
data = request.json
|
||||
api_url = f"{current_app.config['API_BASE_URL']}/StatusCall"
|
||||
api_url = f"{BASE_URL}/StatusCall"
|
||||
|
||||
# response = requests.post(api_url, json=data, headers=get_headers())
|
||||
# return jsonify(response.json()), response.status_code
|
||||
@@ -47,7 +51,7 @@ def status_call():
|
||||
@auth_bp.route("/sms", methods=["POST"])
|
||||
def sms():
|
||||
data = request.json
|
||||
api_url = f"{current_app.config['API_BASE_URL']}/SMS"
|
||||
api_url = f"{BASE_URL}/SMS"
|
||||
|
||||
# response = requests.post(api_url, json=data, headers=get_headers())
|
||||
# return jsonify(response.json()), response.status_code
|
||||
@@ -64,7 +68,7 @@ def sms():
|
||||
@auth_bp.route("/bulk-sms", methods=["POST"])
|
||||
def bulk_sms():
|
||||
data = request.json
|
||||
api_url = f"{current_app.config['API_BASE_URL']}/BulkSMS"
|
||||
api_url = f"{BASE_URL}/BulkSMS"
|
||||
|
||||
# response = requests.post(api_url, json=data, headers=get_headers())
|
||||
# return jsonify(response.json()), response.status_code
|
||||
|
||||
Reference in New Issue
Block a user