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 dbgst = Blueprint('dbgst', __name__) @dbgst.route('/dbgst/reqtest') def retest(): return "success" # 1.1. Create @dbgst.route('/dbgst/create', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def createdbgst(): req = request.json resp = bllengine.dbgst_processcreate(req) return jsonify(resp) # 1.2. Read One Conditional @dbgst.route('/dbgst/readonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readOnedbgstwithCondition(): req = request.json resp = bllengine.dbgst_processreadonecond(req) return jsonify(resp) # 1.3. Read Multiple Conditional @dbgst.route('/dbgst/readmanycond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def reaManydbgstwithCond(): req = request.json resp = bllengine.dbgst_processreadmanycond(req) return jsonify(resp) # 1.4. Read All @dbgst.route('/dbgst/readall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readManydbgstwithoutCond(): req = request.json resp = bllengine.dbgst_processreadmanywithoutcond(req) return jsonify(resp) # 1.5. Delete One Conditional @dbgst.route('/dbgst/deleteonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def deleteOnedbgstwithcondition(): req = request.json resp = bllengine.dbgst_processdeleteonecond(req) return jsonify(resp) # 1.6. Update One Conditional @dbgst.route('/dbgst/updateonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def updateonedbgstwithcondition(): req = request.json resp = bllengine.dbgst_processupdateonecond(req) return jsonify(resp) """"# 1.7. Update All @dbgst.route('/dbgst/updateall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbgst(): req = request.json resp = bllengine.dbgst_processupdateall(req) return jsonify(resp) """