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

91 lines
2.2 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
dbpo = Blueprint('dbpo', __name__)
@dbpo.route('/dbpo/reqtest')
def retest():
return "success"
# 1.1. Create
@dbpo.route('/dbpo/create', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbpo():
req = request.json
resp = bllengine.dbpo_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
@dbpo.route('/dbpo/readonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readOnedbpowithCondition():
req = request.json
resp = bllengine.dbpo_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
@dbpo.route('/dbpo/readmanycond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def reaManydbpowithCond():
req = request.json
resp = bllengine.dbpo_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
@dbpo.route('/dbpo/readall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readManydbpowithoutCond():
req = request.json
resp = bllengine.dbpo_processreadmanywithoutcond(req)
return jsonify(resp)
# 1.5. Delete One Conditional
@dbpo.route('/dbpo/deleteonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def deleteOnedbpowithcondition():
req = request.json
resp = bllengine.dbpo_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
@dbpo.route('/dbpo/updateonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def updateonedbpowithcondition():
req = request.json
resp = bllengine.dbpo_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
@dbpo.route('/dbpo/updateall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbpo():
req = request.json
resp = bllengine.dbpo_processupdateall(req)
return jsonify(resp)
"""