dbilayer_oracle/reqhandlers/dbcustomer.py

91 lines
2.4 KiB
Python
Raw Permalink Normal View History

2023-05-15 18:06:03 +05:30
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
dbcustomer = Blueprint('dbcustomer', __name__)
@dbcustomer.route('/dbcustomer/reqtest')
def retest():
return "success"
# 1.1. Create
@dbcustomer.route('/dbcustomer/create', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbcustomer():
req = request.json
resp = bllengine.dbcustomer_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
@dbcustomer.route('/dbcustomer/readonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readOnedbcustomerwithCondition():
req = request.json
resp = bllengine.dbcustomer_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
@dbcustomer.route('/dbcustomer/readmanycond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def reaManydbcustomerwithCond():
req = request.json
resp = bllengine.dbcustomer_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
@dbcustomer.route('/dbcustomer/readall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readManydbcustomerwithoutCond():
req = request.json
resp = bllengine.dbcustomer_processreadall(req)
return jsonify(resp)
# 1.5. Delete One Conditional
@dbcustomer.route('/dbcustomer/deleteonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def deleteOnedbcustomerwithcondition():
req = request.json
resp = bllengine.dbcustomer_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
@dbcustomer.route('/dbcustomer/updateonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def updateonedbcustomerwithcondition():
req = request.json
resp = bllengine.dbcustomer_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
@dbcustomer.route('/dbcustomer/updateall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbcustomer():
req = request.json
resp = bllengine.dbcustomer_processupdateall(req)
return jsonify(resp)
"""