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 dbcollection = Blueprint('dbcollection', __name__) @dbcollection.route('/dbcollection/reqtest') def retest(): return "success" # 1.1. Create @dbcollection.route('/dbcollection/create', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbcollection(): req = request.json resp = bllengine.dbcollection_processcreate(req) return jsonify(resp) # 1.2. Read One Conditional @dbcollection.route('/dbcollection/readonecond', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def readOnedbcollectionwithCondition(): req = request.json resp = bllengine.dbcollection_processreadonecond(req) return jsonify(resp) # 1.3. Read Multiple Conditional @dbcollection.route('/dbcollection/readmanycond', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def reaManydbcollectionwithCond(): req = request.json resp = bllengine.dbcollection_processreadmanycond(req) return jsonify(resp) # 1.4. Read All @dbcollection.route('/dbcollection/readall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readManydbcollectionwithoutCond(): req = request.json resp = bllengine.dbcollection_processreadall(req) return jsonify(resp) # 1.5. Delete One Conditional @dbcollection.route('/dbcollection/deleteonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def deleteOnedbcollectionwithcondition(): req = request.json resp = bllengine.dbcollection_processdeleteonecond(req) return jsonify(resp) # 1.6. Update One Conditional @dbcollection.route('/dbcollection/updateonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def updateonedbcollectionwithcondition(): req = request.json resp = bllengine.dbcollection_processupdateonecond(req) return jsonify(resp) """"# 1.7. Update All @dbcollection.route('/dbcollection/updateall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createdbcollection(): req = request.json resp = bllengine.dbcollection_processupdateall(req) return jsonify(resp) """