dbilayer_oracle/reqhandlers/dbemail.py
2023-05-15 18:06:03 +05:30

91 lines
2.3 KiB
Python

from flask import Blueprint, request, jsonify
from core.bll import bllengine
from flask_cors import cross_origin
from flask_jwt_extended import create_access_token, get_jwt, jwt_required
from reqhandlers.blocklist import BLOCKLIST
import datetime
from datetime import timedelta
dbemail = Blueprint('dbemail', __name__)
@dbemail.route('/dbemail/reqtest')
def retest():
return "success"
# 1.1. Create
@dbemail.route('/dbemail/create', methods=["POST"])
@cross_origin()
##@jwt_required()
#@cache.cached(timeout=50)
def createdbemail():
req = request.json
resp = bllengine.dbemail_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
@dbemail.route('/dbemail/readonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readOnedbemailwithCondition():
req = request.json
resp = bllengine.dbemail_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
@dbemail.route('/dbemail/readmanycond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def reaManydbemailwithCond():
req = request.json
resp = bllengine.dbemail_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
@dbemail.route('/dbemail/readall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readManydbemailwithoutCond():
req = request.json
resp = bllengine.dbemail_processreadmanywithoutcond(req)
return jsonify(resp)
# 1.5. Delete One Conditional
@dbemail.route('/dbemail/deleteonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def deleteOnedbemailwithcondition():
req = request.json
resp = bllengine.dbemail_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
@dbemail.route('/dbemail/updateonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def updateonedbemailwithcondition():
req = request.json
resp = bllengine.dbemail_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
@dbemail.route('/dbemail/updateall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbemail():
req = request.json
resp = bllengine.dbemail_processupdateall(req)
return jsonify(resp)
"""