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 dbuname = Blueprint('dbuname', __name__) @dbuname.route('/dbuname/reqtest') def retest(): return "success" # 1.1. Create @dbuname.route('/dbuname/create', methods=["POST"]) @cross_origin() # @jwt_required() #@cache.cached(timeout=50) def createdbuname(): req = request.json resp = bllengine.dbusername_processcreate(req) return jsonify(resp) # 1.2. Read One Conditional @dbuname.route('/dbuname/readonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readOnedbunamewithCondition(): req = request.json resp = bllengine.dbusername_processreadonecond(req) return jsonify(resp) # 1.3. Read Multiple Conditional @dbuname.route('/dbuname/readmanycond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def reaManydbunamewithCond(): req = request.json resp = bllengine.dbusername_processreadmanycond(req) return jsonify(resp) # 1.4. Read All @dbuname.route('/dbuname/readall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readManydbunamewithoutCond(): req = request.json resp = bllengine.dbusername_processreadall(req) return jsonify(resp) # 1.5. Delete One Conditional @dbuname.route('/dbuname/deleteonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def deleteOnedbunamewithcondition(): req = request.json resp = bllengine.dbusername_processdeleteonecond(req) return jsonify(resp) # 1.6. Update One Conditional @dbuname.route('/dbuname/updateonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def updateonedbunamewithcondition(): req = request.json resp = bllengine.dbusername_processupdateonecond(req) return jsonify(resp) """"# 1.7. Update All @dbuname.route('/dbuname/updateall', methods=["POST"]) @cross_origin() @jwt_required() #@cache.cached(timeout=50) async def createdbuname(): req = request.json resp = bllengine.dbuname_processupdateall(req) return jsonify(resp) """