dbilayer_cassandra/reqhandlers/dbdelnote.py
2023-04-21 10:39:08 +05:30

97 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
import uuid
dbdelnote = Blueprint('dbdelnote', __name__)
@dbdelnote.route('/dbdelnote/reqtest')
def retest():
return "success"
# 1.1. Create
@dbdelnote.route('/dbdelnote/create', methods=["POST"])
@cross_origin()
##@jwt_required()
#@cache.cached(timeout=50)
def createdbdelnote():
uuid_number=uuid_number=uuid.uuid4().hex
print("uuid number",uuid_number)
print(uuid_number)
req = request.json
print("values for insert",req, uuid_number)
req['requestdata']['id']=uuid_number
resp = bllengine.dbdelnote_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
@dbdelnote.route('/dbdelnote/readonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readOnedbdelnotewithCondition():
req = request.json
resp = bllengine.dbdelnote_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
@dbdelnote.route('/dbdelnote/readmanycond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def reaManydbdelnotewithCond():
req = request.json
resp = bllengine.dbdelnote_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
@dbdelnote.route('/dbdelnote/readall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readManydbdelnotewithoutCond():
req = request.json
resp = bllengine.dbdelnote_processreadall(req)
return jsonify(resp)
# 1.5. Delete One Conditional
@dbdelnote.route('/dbdelnote/deleteonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def deleteOnedbdelnotewithcondition():
req = request.json
resp = bllengine.dbdelnote_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
@dbdelnote.route('/dbdelnote/updateonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def updateonedbdelnotewithcondition():
req = request.json
resp = bllengine.dbdelnote_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
@dbdelnote.route('/dbdelnote/updateall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbdelnote():
req = request.json
resp = bllengine.dbdelnote_processupdateall(req)
return jsonify(resp)
"""