Exemple #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)
Exemple #2
0
def getSupplierById(uid):
    return UserHandler ().getSupplierById (uid)
Exemple #3
0
def getAllSuppliers():
    return UserHandler ().getAllSuppliers ()
Exemple #4
0
def getCustomerById(uid):
    return UserHandler ().getCustomerById (uid)
Exemple #5
0
def getAllCustomers():
    return UserHandler ().getAllCustomers ()
Exemple #6
0
def getUserById(uid):
    return UserHandler ().getUserById (uid)
Exemple #7
0
def getResourcesBySupplierId(uid):
    return UserHandler ().getResourcesBySupplierId(uid)
Exemple #8
0
def getInformationOfUserById(uid):
    return UserHandler().getInformationOfUserById(uid)
Exemple #9
0
def getInformationOfUserByUsername(username):
    return UserHandler().getInformationOfUserByUsername(username)
Exemple #10
0
def users():
    handler = UserHandler()
    return handler.getAllUsers()
Exemple #11
0
def getNumberMessagesByUserId(uid):
    return UserHandler().getNumberMessagesByUserId(uid)
Exemple #12
0
def getAllChatsByUserId(uid):
    return UserHandler().getAllChatsByUserId(uid)
Exemple #13
0
def register():
    if request.method =='POST':
        return UserHandler().insertUser(request.get_json('data'))
Exemple #14
0
def login():
    if request.method == 'POST':
        return UserHandler().getCredentials(request.get_json('data'))