dbilayer_oracle/reqhandlers/dborganization.py
2023-05-15 18:06:03 +05:30

91 lines
2.5 KiB
Python

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
dborganization = Blueprint('dborganization', __name__)
@dborganization.route('/dborganization/reqtest')
def retest():
return "success"
# 1.1. Create
@dborganization.route('/dborganization/create', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdborganization():
req = request.json
resp = bllengine.dborganization_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
@dborganization.route('/dborganization/readonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readOnedborganizationwithCondition():
req = request.json
resp = bllengine.dborganization_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
@dborganization.route('/dborganization/readmanycond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def reaManydborganizationwithCond():
req = request.json
resp = bllengine.dborganization_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
@dborganization.route('/dborganization/readall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readManydborganizationwithoutCond():
req = request.json
resp = bllengine.dborganization_processreadmanywithoutcond(req)
return jsonify(resp)
# 1.5. Delete One Conditional
@dborganization.route('/dborganization/deleteonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def deleteOnedborganizationwithcondition():
req = request.json
resp = bllengine.dborganization_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
@dborganization.route('/dborganization/updateonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def updateonedborganizationwithcondition():
req = request.json
resp = bllengine.dborganization_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
@dborganization.route('/dborganization/updateall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdborganization():
req = request.json
resp = bllengine.dborganization_processupdateall(req)
return jsonify(resp)
"""