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 dbauth = Blueprint('dbauth', __name__) @dbauth.route('/dbauth/reqtest') def retest(): return "success" # 1.1. Create @dbauth.route('/dbauth/create', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbauth(): req = request.json resp = bllengine.dbauth_processcreate(req) return jsonify(resp) # 1.2. Read One Conditional @dbauth.route('/dbauth/readonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readOnedbauthwithCondition(): req = request.json resp = bllengine.dbauth_processreadonecond(req) return jsonify(resp) # 1.3. Read Multiple Conditional @dbauth.route('/dbauth/readmanycond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def reaManydbauthwithCond(): req = request.json resp = bllengine.dbauth_processreadmanycond(req) return jsonify(resp) # 1.4. Read All @dbauth.route('/dbauth/readall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readManydbauthwithoutCond(): req = request.json resp = bllengine.dbauth_processreadall(req) return jsonify(resp) # 1.5. Delete One Conditional @dbauth.route('/dbauth/deleteonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def deleteOnedbauthwithcondition(): req = request.json resp = bllengine.dbauth_processdeleteonecond(req) return jsonify(resp) # 1.6. Update One Conditional @dbauth.route('/dbauth/updateonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def updateonedbauthwithcondition(): req = request.json resp = bllengine.dbauth_processupdateonecond(req) return jsonify(resp) """"# 1.7. Update All @dbauth.route('/dbauth/updateall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbauth(): req = request.json resp = bllengine.dbauth_processupdateall(req) return jsonify(resp) """