Пример #1
0
 def getUsersWhoDislikeMessage(self, mid):
     dao = MessagesDAO()
     result = dao.getUsersWhoDislikeMessage(mid)
     mapped_result = []
     for r in result:
         mapped_result.append(buildDict.build_users_dict(self, r))
     return jsonify(Users=mapped_result)
Пример #2
0
 def getContactsOfUser(self, uid):
     dao = UsersDAO()
     result = dao.getContactsOfUser(uid)
     mapped_result = []
     for r in result:
         mapped_result.append(buildDict.build_users_dict(self, r))
     return jsonify(Contacts=mapped_result)
Пример #3
0
 def loginUser(self, form):
     username = form['username']
     password = form['password']
     dao = UsersDAO()
     result = dao.loginUser(username, password)
     mapped = buildDict.build_users_dict(self, result)
     return jsonify(Users=mapped)
Пример #4
0
 def getAllUsers(self):
     dao = UsersDAO()
     result = dao.getAllUsers()
     mapped_result = []
     for r in result:
         mapped_result.append(buildDict.build_users_dict(self, r))
     return jsonify(Users=mapped_result)
Пример #5
0
 def getUsersInAGroupChat(self, gid):
     dao = GroupChatsDAO()
     result = dao.getUsersInAGroupChat(gid)
     mapped = []
     for r in result:
         mapped.append(buildDict.build_users_dict(self, r))
     return jsonify(Users=mapped)
Пример #6
0
 def getUserById(self, id):
     dao = UsersDAO()
     result = dao.getUserById(id)
     if result is None:
         return jsonify(Error="NOT FOUND"), 404
     else:
         mapped = buildDict.build_users_dict(self, result)
         return jsonify(Users=mapped)
Пример #7
0
 def getOwnerOfGroupChat(self, gid):
     dao = GroupChatsDAO()
     result = dao.getOwnerOfGroupChat(gid)
     if result is None:
         return jsonify(Error="NOT FOUND"), 404
     else:
         mapped = buildDict.build_users_dict(self, result)
         return jsonify(Owner=mapped)
Пример #8
0
 def getUserInformationByUsername(self, username):
     dao = UsersDAO()
     result = dao.getUserInformationByUsername(username)
     if result is None:
         return jsonify(Error="NOT FOUND"), 404
     else:
         # TODO: Edit
         mapped = buildDict.build_users_dict(self, result)
         return jsonify(Users=mapped)