def getALLConsumers():
    if request.method == 'POST':
        return ConsumerHandler().insertConsumer(request.form)
    else:
        if not request.args:
            return ConsumerHandler().getAllConsumers()
        else:
            return ConsumerHandler().searchConsumers(request.args)
示例#2
0
def getCConsumerById(consid):
    if request.method == 'GET':
        return ConsumerHandler().getConsumerById(consid)
    elif request.method == 'PUT':
        return ConsumerHandler().updateConsumer(consid, request.json)
    elif request.method == 'DELETE':
        return ConsumerHandler().deleteConsumer(consid)
    else:
        return jsonify(Error="Method not allowed."), 405
示例#3
0
def getAllConsumer():
    if request.method == 'POST':
        print("REQUEST: ", request.json)
        return ConsumerHandler().insertConsumerJson(request.json)
    else:
        if not request.json:
            return ConsumerHandler().getAllConsumer()
        else:
            return ConsumerHandler().searchConsumer(request.json)
def getConsumerById(cid):
    if request.method == 'GET':
        return ConsumerHandler().getConsumerById(cid)
    elif request.method == 'PUT':
        pass
    elif request.method == 'DELETE':
        pass
    else:
        return jsonify(Error = "Method not allowed"), 405
示例#5
0
def getAllconsumer():
    if request.method == 'POST':
        print("REQUEST: ", request.json)
        return UserHandler().insertConsumerJson(request.json)
    if request.method == 'GET':
        return ConsumerHandler().getAllConsumer()
示例#6
0
def getAllConsumer():

    if request.method == 'GET':
        return ConsumerHandler().getAllConsumers()
示例#7
0
def getConsumerById(consumer_id):
    # orders specify if we are requesting, reserving or purchasing depending on its status
    if request.method == 'GET':
        return ConsumerHandler().getConsumerById(consumer_id)
示例#8
0
def registerConsumer():
    # orders specify if we are requesting, reserving or purchasing depending on its status
    if request.method == 'GET':
        return ConsumerHandler().getAllConsumers()
    elif request.method == 'POST':
        return ConsumerHandler().insert(request.get_json())
示例#9
0
def getOrdersByConsumerId(consid):
    return ConsumerHandler().getOrdersByConsumerId(consid)
示例#10
0
def getResourcesByConsumerId(consid):
    return ConsumerHandler().getResourcesByConsumerId(consid)
示例#11
0
def getReservationByConsumerId(consid):
    return ConsumerHandler().getReservationByConsumerId(consid)
示例#12
0
def getPayMethodByConsumerId(consid):
    return ConsumerHandler().getPayMethodByConsumerId(consid)
def getLatestConsumer():
    return ConsumerHandler().getLatestConsumer()