Exemplo n.º 1
0
def getUsers():
    if request.method == 'POST':
        userDic = {}
        userDic['uname'] = request.args.get ('uname')
        userDic['ulast'] = request.args.get ('ulast')
        userDic['utype'] = request.args.get ('utype')
        userAddressDic = {}
        userAddressDic['uaddress'] = request.args.get ('uaddress')
        userAddressDic['ucity'] = request.args.get ('ucity')
        userAddressDic['uregion'] = request.args.get ('uregion')
        userAddressDic['uzip'] = request.args.get ('uzip')
        userAddressDic['ustate'] = request.args.get ('ustate')
        userAddressDic['loclat'] = request.args.get ('loclat')
        userAddressDic['loclon'] = request.args.get ('loclon')
        return UserHandler().insertUser(userDic,userAddressDic)

    elif request.method == 'PUT':
        userDic = {}
        userDic['uid'] = request.args.get ('uid')
        userDic['uname'] = request.args.get ('uname')
        userDic['ulast'] = request.args.get ('ulast')
        userDic['utype'] = request.args.get ('utype')
        userAddressDic = {}
        userAddressDic['uaddress'] = request.args.get ('uaddress')
        userAddressDic['ucity'] = request.args.get ('ucity')
        userAddressDic['uregion'] = request.args.get ('uregion')
        userAddressDic['uzip'] = request.args.get ('uzip')
        userAddressDic['ustate'] = request.args.get ('ustate')
        userAddressDic['loclat'] = request.args.get ('loclat')
        userAddressDic['loclon'] = request.args.get ('loclon')
        return UserHandler().updateUser(userDic,userAddressDic)

    elif request.method == 'DELETE':
        uid = request.args.get ('uid')
        return UserHandler ().deleteUser (uid)

    else:
        if not request.args:
            return UserHandler().getAllUsers()
        else:
            return UserHandler().searchUsers(request.args)
Exemplo n.º 2
0
def getSupplierById(uid):
    return UserHandler ().getSupplierById (uid)
Exemplo n.º 3
0
def getAllSuppliers():
    return UserHandler ().getAllSuppliers ()
Exemplo n.º 4
0
def getCustomerById(uid):
    return UserHandler ().getCustomerById (uid)
Exemplo n.º 5
0
def getAllCustomers():
    return UserHandler ().getAllCustomers ()
Exemplo n.º 6
0
def getUserById(uid):
    return UserHandler ().getUserById (uid)
Exemplo n.º 7
0
def getResourcesBySupplierId(uid):
    return UserHandler ().getResourcesBySupplierId(uid)
Exemplo n.º 8
0
def getInformationOfUserById(uid):
    return UserHandler().getInformationOfUserById(uid)
Exemplo n.º 9
0
def getInformationOfUserByUsername(username):
    return UserHandler().getInformationOfUserByUsername(username)
Exemplo n.º 10
0
def users():
    handler = UserHandler()
    return handler.getAllUsers()
Exemplo n.º 11
0
def getNumberMessagesByUserId(uid):
    return UserHandler().getNumberMessagesByUserId(uid)
Exemplo n.º 12
0
def getAllChatsByUserId(uid):
    return UserHandler().getAllChatsByUserId(uid)
Exemplo n.º 13
0
def register():
    if request.method =='POST':
        return UserHandler().insertUser(request.get_json('data'))
Exemplo n.º 14
0
def login():
    if request.method == 'POST':
        return UserHandler().getCredentials(request.get_json('data'))