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 dbname = Blueprint('dbname', __name__) @dbname.route('/dbname/reqtest') def retest(): return "success" # 1.1. Create @dbname.route('/dbname/create', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbname(): req = request.json resp = bllengine.dbname_processcreate(req) return jsonify(resp) # 1.2. Read One Conditional @dbname.route('/dbname/readonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readOnedbnamewithCondition(): req = request.json resp = bllengine.dbname_processreadonecond(req) return jsonify(resp) # 1.3. Read Multiple Conditional @dbname.route('/dbname/readmanycond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def reaManydbnamewithCond(): req = request.json resp = bllengine.dbname_processreadmanycond(req) return jsonify(resp) # 1.4. Read All @dbname.route('/dbname/readall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readManydbnamewithoutCond(): req = request.json resp = bllengine.dbname_processreadmanywithoutcond(req) return jsonify(resp) # 1.5. Delete One Conditional @dbname.route('/dbname/deleteonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def deleteOnedbnamewithcondition(): req = request.json resp = bllengine.dbname_processdeleteonecond(req) return jsonify(resp) # 1.6. Update One Conditional @dbname.route('/dbname/updateonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def updateonedbnamewithcondition(): req = request.json resp = bllengine.dbname_processupdateonecond(req) return jsonify(resp) """"# 1.7. Update All @dbname.route('/dbname/updateall', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def createdbname(): req = request.json resp = bllengine.dbname_processupdateall(req) return jsonify(resp) """