dbilayer_cassandra/reqhandlers/dbusername.py

97 lines
2.6 KiB
Python
Raw Permalink 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
2023-04-21 10:39:08 +05:30
dbusername = Blueprint('dbusername', __name__)
2023-04-03 17:17:27 +05:30
2023-04-21 10:39:08 +05:30
@dbusername.route('/dbusername/reqtest')
2023-04-03 17:17:27 +05:30
def retest():
return "success"
# 1.1. Create
2023-04-21 10:39:08 +05:30
@dbusername.route('/dbusername/create', methods=["POST"])
2023-04-03 17:17:27 +05:30
@cross_origin()
# @jwt_required()
#@cache.cached(timeout=50)
2023-04-21 10:39:08 +05:30
def createdbusername():
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.dbusername_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
2023-04-21 10:39:08 +05:30
@dbusername.route('/dbusername/readonecond', methods=["POST"])
2023-04-03 17:17:27 +05:30
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
2023-04-21 10:39:08 +05:30
def readOnedbusernamewithCondition():
2023-04-03 17:17:27 +05:30
req = request.json
resp = bllengine.dbusername_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
2023-04-21 10:39:08 +05:30
@dbusername.route('/dbusername/readmanycond', methods=["POST"])
2023-04-03 17:17:27 +05:30
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
2023-04-21 10:39:08 +05:30
def reaManydbusernamewithCond():
2023-04-03 17:17:27 +05:30
req = request.json
resp = bllengine.dbusername_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
2023-04-21 10:39:08 +05:30
@dbusername.route('/dbusername/readall', methods=["POST"])
2023-04-03 17:17:27 +05:30
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
2023-04-21 10:39:08 +05:30
def readManydbusernamewithoutCond():
2023-04-03 17:17:27 +05:30
req = request.json
resp = bllengine.dbusername_processreadall(req)
return jsonify(resp)
# 1.5. Delete One Conditional
2023-04-21 10:39:08 +05:30
@dbusername.route('/dbusername/deleteonecond', methods=["POST"])
2023-04-03 17:17:27 +05:30
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
2023-04-21 10:39:08 +05:30
def deleteOnedbusernamewithcondition():
2023-04-03 17:17:27 +05:30
req = request.json
resp = bllengine.dbusername_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
2023-04-21 10:39:08 +05:30
@dbusername.route('/dbusername/updateonecond', methods=["POST"])
2023-04-03 17:17:27 +05:30
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
2023-04-21 10:39:08 +05:30
def updateonedbusernamewithcondition():
2023-04-03 17:17:27 +05:30
req = request.json
resp = bllengine.dbusername_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
2023-04-21 10:39:08 +05:30
@dbusername.route('/dbusername/updateall', methods=["POST"])
2023-04-03 17:17:27 +05:30
@cross_origin()
@jwt_required()
#@cache.cached(timeout=50)
2023-04-21 10:39:08 +05:30
async def createdbusername():
2023-04-03 17:17:27 +05:30
req = request.json
2023-04-21 10:39:08 +05:30
resp = bllengine.dbusername_processupdateall(req)
2023-04-03 17:17:27 +05:30
return jsonify(resp)
"""