dbilayer_cassandra/reqhandlers/dbauth.py

94 lines
2.4 KiB
Python
Raw Normal View History

2023-04-03 17:17:27 +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
2023-04-21 10:39:08 +05:30
import uuid
2023-04-03 17:17:27 +05:30
dbauth = Blueprint('dbauth', __name__)
@dbauth.route('/dbauth/reqtest')
def retest():
return "success"
# 1.1. Create
@dbauth.route('/dbauth/create', methods=["POST"])
@cross_origin()
#@jwt_required()
2023-04-21 10:39:08 +05:30
#@cache.cached(timeout=50)
2023-04-03 17:17:27 +05:30
def createdbauth():
2023-04-21 10:39:08 +05:30
uuid_number=uuid_number=uuid.uuid4().hex
print("uuid number",uuid_number)
print(uuid_number)
2023-04-03 17:17:27 +05:30
req = request.json
2023-04-21 10:39:08 +05:30
print("values for insert",req, uuid_number)
req['requestdata']['id']=uuid_number
2023-04-03 17:17:27 +05:30
resp = bllengine.dbauth_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
@dbauth.route('/dbauth/readonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readOnedbauthwithCondition():
req = request.json
resp = bllengine.dbauth_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
@dbauth.route('/dbauth/readmanycond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def reaManydbauthwithCond():
req = request.json
resp = bllengine.dbauth_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
@dbauth.route('/dbauth/readall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readManydbauthwithoutCond():
req = request.json
resp = bllengine.dbauth_processreadall(req)
return jsonify(resp)
# 1.5. Delete One Conditional
@dbauth.route('/dbauth/deleteonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def deleteOnedbauthwithcondition():
req = request.json
resp = bllengine.dbauth_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
@dbauth.route('/dbauth/updateonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def updateonedbauthwithcondition():
req = request.json
resp = bllengine.dbauth_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
@dbauth.route('/dbauth/updateall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbauth():
req = request.json
resp = bllengine.dbauth_processupdateall(req)
return jsonify(resp)
"""