dbilayer_cassandra/reqhandlers/dborders.py
2023-04-03 17:17:27 +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
dborders = Blueprint('dborders', __name__)
@dborders.route('/dborders/reqtest')
def retest():
return "success"
# 1.1. Create
@dborders.route('/dborders/create', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdborders():
req = request.json
resp = bllengine.dborders_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
@dborders.route('/dborders/readonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readOnedborderswithCondition():
req = request.json
resp = bllengine.dborders_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
@dborders.route('/dborders/readmanycond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def reaManydborderswithCond():
req = request.json
resp = bllengine.dborders_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
@dborders.route('/dborders/readall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readManydborderswithoutCond():
req = request.json
resp = bllengine.dborders_processreadmanywithoutcond(req)
return jsonify(resp)
# 1.5. Delete One Conditional
@dborders.route('/dborders/deleteonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def deleteOnedborderswithcondition():
req = request.json
resp = bllengine.dborders_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
@dborders.route('/dborders/updateonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def updateonedborderswithcondition():
req = request.json
resp = bllengine.dborders_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
@dborders.route('/dborders/updateall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdborders():
req = request.json
resp = bllengine.dborders_processupdateall(req)
return jsonify(resp)
"""