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
|
||
|
|
||
|
dbgeninv = Blueprint('dbgeninv', __name__)
|
||
|
|
||
|
|
||
|
|
||
|
@dbgeninv.route('/dbgeninv/reqtest')
|
||
|
def retest():
|
||
|
return "success"
|
||
|
|
||
|
|
||
|
|
||
|
# 1.1. Create
|
||
|
@dbgeninv.route('/dbgeninv/create', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
#@jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def createdbgeninv():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbgeninv_processcreate(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
# 1.2. Read One Conditional
|
||
|
@dbgeninv.route('/dbgeninv/readonecond', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
#@jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def readOnedbgeninvwithCondition():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbgeninv_processreadonecond(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
# 1.3. Read Multiple Conditional
|
||
|
@dbgeninv.route('/dbgeninv/readmanycond', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
#@jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def reaManydbgeninvwithCond():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbgeninv_processreadmanycond(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
# 1.4. Read All
|
||
|
@dbgeninv.route('/dbgeninv/readall', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
#@jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def readManydbgeninvwithoutCond():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbgeninv_processreadmanywithoutcond(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
# 1.5. Delete One Conditional
|
||
|
@dbgeninv.route('/dbgeninv/deleteonecond', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
#@jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def deleteOnedbgeninvwithcondition():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbgeninv_processdeleteonecond(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
|
||
|
# 1.6. Update One Conditional
|
||
|
@dbgeninv.route('/dbgeninv/updateonecond', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
#@jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def updateonedbgeninvwithcondition():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbgeninv_processupdateonecond(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
|
||
|
""""# 1.7. Update All
|
||
|
@dbgeninv.route('/dbgeninv/updateall', methods=["POST"])
|
||
|
@cross_origin()
|
||
|
#@jwt_required()
|
||
|
#@cache.cached(timeout=50)
|
||
|
def createdbgeninv():
|
||
|
req = request.json
|
||
|
resp = bllengine.dbgeninv_processupdateall(req)
|
||
|
return jsonify(resp)
|
||
|
|
||
|
"""
|