Dbilayer_mssql/reqhandlers/dbcity.py

91 lines
2.2 KiB
Python
Raw Normal View History

2023-04-03 16:30:34 +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
dbcity = Blueprint('dbcity', __name__)
@dbcity.route('/dbcity/reqtest')
def retest():
return "success"
# 1.1. Create
@dbcity.route('/dbcity/create', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbcity():
req = request.json
resp = bllengine.dbcity_processcreate(req)
return jsonify(resp)
# 1.2. Read One Conditional
@dbcity.route('/dbcity/readonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def readOnedbcitywithCondition():
req = request.json
resp = bllengine.dbcity_processreadonecond(req)
return jsonify(resp)
# 1.3. Read Multiple Conditional
@dbcity.route('/dbcity/readmanycond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.csached(timeout=50)
def reaManydbcitywithCond():
req = request.json
resp = bllengine.dbcity_processreadmanycond(req)
return jsonify(resp)
# 1.4. Read All
@dbcity.route('/dbcity/readall', methods=["POST"])
@cross_origin()
##@jwt_required()
#@cache.cached(timeout=50)
def readManydbcitywithoutCond():
req = request.json
resp = bllengine.dbcity_processreadall(req)
return jsonify(resp)
# 1.5. Delete One Conditional
@dbcity.route('/dbcity/deleteonecond', methods=["POST"])
@cross_origin()
##@jwt_required()
#@cache.cached(timeout=50)
def deleteOnedbcitywithcondition():
req = request.json
resp = bllengine.dbcity_processdeleteonecond(req)
return jsonify(resp)
# 1.6. Update One Conditional
@dbcity.route('/dbcity/updateonecond', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def updateonedbcitywithcondition():
req = request.json
resp = bllengine.dbcity_processupdateonecond(req)
return jsonify(resp)
""""# 1.7. Update All
@dbcity.route('/dbcity/updateall', methods=["POST"])
@cross_origin()
#@jwt_required()
#@cache.cached(timeout=50)
def createdbcity():
req = request.json
resp = bllengine.dbcity_processupdateall(req)
return jsonify(resp)
"""