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 dbprod = Blueprint('dbprod', __name__) @dbprod.route('/dbprod/reqtest') def retest(): return "success" # 1.1. Create @dbprod.route('/dbprod/create', methods=["POST"]) @cross_origin() ##@jwt_required() #@cache.cached(timeout=50) def createPropSet(): req = request.json resp = bllengine.dbprod_processcreate(req) return jsonify(resp) # 1.2. Read One Conditional @dbprod.route('/dbprod/readonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readOnePropSetwithCondition(): req = request.json resp = bllengine.dbprod_processreadonecond(req) return jsonify(resp) # 1.3. Read Multiple Conditional @dbprod.route('/dbprod/readmanycond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def reaManyPropSetwithCond(): req = request.json resp = bllengine.dbprod_processreadmanycond(req) return jsonify(resp) # 1.4. Read All @dbprod.route('/dbprod/readall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def readManyPropSetwithoutCond(): req = request.json resp = bllengine.dbprod_processreadmanywithoutcond(req) return jsonify(resp) # 1.5. Delete One Conditional @dbprod.route('/dbprod/deleteonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def deleteOnePropSetwithcondition(): req = request.json resp = bllengine.dbprod_processdeleteonecond(req) return jsonify(resp) # 1.6. Update One Conditional @dbprod.route('/dbprod/updateonecond', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def updateonePropSetwithcondition(): req = request.json resp = bllengine.dbprod_processupdateonecond(req) return jsonify(resp) """"# 1.7. Update All @dbprod.route('/dbprod/updateall', methods=["POST"]) @cross_origin() #@jwt_required() #@cache.cached(timeout=50) def createPropSet(): req = request.json resp = bllengine.dbprod_processupdateall(req) return jsonify(resp) """