97 lines
2.7 KiB
Python
97 lines
2.7 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
|
||
|
|
||
|
dbvariabletype = Blueprint('dbvariabletype', __name__)
|
||
|
|
||
|
|
||
|
|
||
|
@dbvariabletype.route('/dbvariabletype/reqtest')
|
||
|
def retest():
|
||
|
return "success"
|
||
|
|
||
|
|
||
|
|
||
|
# 1.1. Create
|
||
|
@dbvariabletype.route('/dbvariabletype/create', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
# @jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def createdbvariabletype():
|
||
|
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.dbvariabletype_processcreate(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
# 1.2. Read One Conditional
|
||
|
@dbvariabletype.route('/dbvariabletype/readonecond', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
# @jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def readOnedbvariabletypewithCondition():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbvariabletype_processreadonecond(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
# 1.3. Read Multiple Conditional
|
||
|
@dbvariabletype.route('/dbvariabletype/readmanycond', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
# @jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def reaManydbvariabletypewithCond():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbvariabletype_processreadmanycond(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
# 1.4. Read All
|
||
|
@dbvariabletype.route('/dbvariabletype/readall', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
# @jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def readManydbvariabletypewithoutCond():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbvariabletype_processreadall(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
# 1.5. Delete One Conditional
|
||
|
@dbvariabletype.route('/dbvariabletype/deleteonecond', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
# @jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def deleteOnedbvariabletypewithcondition():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbvariabletype_processdeleteonecond(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
|
||
|
# 1.6. Update One Conditional
|
||
|
@dbvariabletype.route('/dbvariabletype/updateonecond', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
# @jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def updateonedbvariabletypewithcondition():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbvariabletype_processupdateonecond(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
|
||
|
""""# 1.7. Update All
|
||
|
@dbvariabletype.route('/dbvariabletype/updateall', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
@jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
async def createdbvariabletype():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbvariabletype_processupdateall(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
"""
|