Exemplo n.º 1
0
 def getUserById(self, user_id):
     dao = UsersDAO()
     row = dao.getUserById(user_id)
     if not row:
         return jsonify(Error="User Not Found"), 404
     else:
         user = self.build_full_user_dict(row)
         return jsonify(User=user)
Exemplo n.º 2
0
 def getUserContactList(self, user_id):
     dao = UsersDAO()
     row = dao.getUserById(user_id)
     if not row:
         return jsonify(Error="User Not Found"), 404
     else:
         contact_list = dao.getUserContactList(user_id)
         result_list = []
         for row in contact_list:
             result = self.build_user_dict(row)
             result_list.append(result)
         return jsonify(Contact=result_list)
Exemplo n.º 3
0
 def getUserChatList(self, user_id):
     dao = UsersDAO()
     user = dao.getUserById(user_id)
     if not user:
         print("UNFH")
         return jsonify(Error="User not found."), 404
     else:
         chat_list = dao.getUserChats(user_id)
         result_list = []
         for row in chat_list:
             result = self.build_user_chat_dict(row)
             result_list.append(result)
         return jsonify(Chat=result_list)