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 dbhash = Blueprint('dbhash', __name__) @dbhash.route('/dbhash/reqtest') def retest(): return "success" # 1.1. Create @dbhash.route('/dbhash/create', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbhash(): req = request.json resp = bllengine.dbhash_processcreate(req) return jsonify(resp) # 1.2. Read One Conditional @dbhash.route('/dbhash/readonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readOnedbhashwithCondition(): req = request.json resp = bllengine.dbhash_processreadonecond(req) return jsonify(resp) # 1.3. Read Multiple Conditional @dbhash.route('/dbhash/readmanycond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def reaManydbhashwithCond(): req = request.json resp = bllengine.dbhash_processreadmanycond(req) return jsonify(resp) # 1.4. Read All @dbhash.route('/dbhash/readall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readManydbhashwithoutCond(): req = request.json resp = bllengine.dbhash_processreadmanywithoutcond(req) return jsonify(resp) # 1.5. Delete One Conditional @dbhash.route('/dbhash/deleteonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def deleteOnedbhashwithcondition(): req = request.json resp = bllengine.dbhash_processdeleteonecond(req) return jsonify(resp) # 1.6. Update One Conditional @dbhash.route('/dbhash/updateonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def updateonedbhashwithcondition(): req = request.json resp = bllengine.dbhash_processupdateonecond(req) return jsonify(resp) """"# 1.7. Update All @dbhash.route('/dbhash/updateall', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def createdbhash(): req = request.json resp = bllengine.dbhash_processupdateall(req) return jsonify(resp) """