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 dbtype = Blueprint('dbtype', __name__) @dbtype.route('/dbtype/reqtest') def retest(): return "success" # 1.1. Create @dbtype.route('/dbtype/create', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def createdbtype(): req = request.json resp = bllengine.dbtype_processcreate(req) return jsonify(resp) # 1.2. Read One Conditional @dbtype.route('/dbtype/readonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readOnedbtypewithCondition(): req = request.json resp = bllengine.dbtype_processreadonecond(req) return jsonify(resp) # 1.3. Read Multiple Conditional @dbtype.route('/dbtype/readmanycond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def reaManydbtypewithCond(): req = request.json resp = bllengine.dbtype_processreadmanycond(req) return jsonify(resp) # 1.4. Read All @dbtype.route('/dbtype/readall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readManydbtypewithoutCond(): req = request.json resp = bllengine.dbtype_processreadall(req) return jsonify(resp) # 1.5. Delete One Conditional @dbtype.route('/dbtype/deleteonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def deleteOnedbtypewithcondition(): req = request.json resp = bllengine.dbtype_processdeleteonecond(req) return jsonify(resp) # 1.6. Update One Conditional @dbtype.route('/dbtype/updateonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def updateonedbtypewithcondition(): req = request.json resp = bllengine.dbtype_processupdateonecond(req) return jsonify(resp) """"# 1.7. Update All @dbtype.route('/dbtype/updateall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbtype(): req = request.json resp = bllengine.dbtype_processupdateall(req) return jsonify(resp) """