91 lines
2.3 KiB
Python
91 lines
2.3 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
|
|
|
|
dbschema = Blueprint('dbschema', __name__)
|
|
|
|
|
|
|
|
@dbschema.route('/dbschema/reqtest')
|
|
def retest():
|
|
return "success"
|
|
|
|
|
|
|
|
# 1.1. Create
|
|
@dbschema.route('/dbschema/create', methods=["POST"])
|
|
@cross_origin()
|
|
#@jw_required()
|
|
#@cache.cached(timeout=50)
|
|
def createdbschema():
|
|
req = request.json
|
|
resp = bllengine.dbschema_processcreate(req)
|
|
return jsonify(resp)
|
|
|
|
# 1.2. Read One Conditional
|
|
@dbschema.route('/dbschema/readonecond', methods=["POST"])
|
|
@cross_origin()
|
|
#@jw_required()
|
|
#@cache.cached(timeout=50)
|
|
def readOnedbschemawithCondition():
|
|
req = request.json
|
|
resp = bllengine.dbschema_processreadonecond(req)
|
|
return jsonify(resp)
|
|
|
|
# 1.3. Read Multiple Conditional
|
|
@dbschema.route('/dbschema/readmanycond', methods=["POST"])
|
|
@cross_origin()
|
|
#@jw_required()
|
|
#@cache.cached(timeout=50)
|
|
def reaManydbschemawithCond():
|
|
req = request.json
|
|
resp = bllengine.dbschema_processreadmanycond(req)
|
|
return jsonify(resp)
|
|
|
|
# 1.4. Read All
|
|
@dbschema.route('/dbschema/readall', methods=["POST"])
|
|
@cross_origin()
|
|
#@jw_required()
|
|
#@cache.cached(timeout=50)
|
|
def readManydbschemawithoutCond():
|
|
req = request.json
|
|
resp = bllengine.dbschema_processreadall(req)
|
|
return jsonify(resp)
|
|
|
|
# 1.5. Delete One Conditional
|
|
@dbschema.route('/dbschema/deleteonecond', methods=["POST"])
|
|
@cross_origin()
|
|
#@jw_required()
|
|
#@cache.cached(timeout=50)
|
|
def deleteOnedbschemawithcondition():
|
|
req = request.json
|
|
resp = bllengine.dbschema_processdeleteonecond(req)
|
|
return jsonify(resp)
|
|
|
|
|
|
# 1.6. Update One Conditional
|
|
@dbschema.route('/dbschema/updateonecond', methods=["POST"])
|
|
@cross_origin()
|
|
#@jw_required()
|
|
#@cache.cached(timeout=50)
|
|
def updateonedbschemawithcondition():
|
|
req = request.json
|
|
resp = bllengine.dbschema_processupdateonecond(req)
|
|
return jsonify(resp)
|
|
|
|
|
|
""""# 1.7. Update All
|
|
@dbschema.route('/dbschema/updateall', methods=["POST"])
|
|
@cross_origin()
|
|
#@jw_required()
|
|
#@cache.cached(timeout=50)
|
|
def createdbschema():
|
|
req = request.json
|
|
resp = bllengine.dbschema_processupdateall(req)
|
|
return jsonify(resp)
|
|
|
|
""" |