Exemplo n.º 1
0
 def getGroupChatbyUserId(self, uid):
     dao = UsersDAO()
     result = dao.getGroupChatbyUserId(uid)
     mapped_result = []
     for r in result:
         mapped_result.append(buildDict.build_groupchats_dict(self, r))
     return jsonify(GroupChats=mapped_result)
Exemplo n.º 2
0
 def getAllGroupChats(self):
     dao = GroupChatsDAO()
     result = dao.getAllGroupChats()
     mapped_result = []
     for r in result:
         mapped_result.append(buildDict.build_groupchats_dict(self, r))
     return jsonify(GroupChats=mapped_result)
Exemplo n.º 3
0
 def getGroupChatById(self, gid):
     dao = GroupChatsDAO()
     result = dao.getGroupChatById(gid)
     if result is None:
         return jsonify(Error="NOT FOUND"), 404
     else:
         mapped = buildDict.build_groupchats_dict(self, result)
         return jsonify(GroupChats=mapped)
Exemplo n.º 4
0
 def createGroupChat(self, uid, form):
     gname = form['gname']
     result = GroupChatsDAO().createGroupChat(uid, gname)
     if result is None:
         return jsonify(Error="NOT FOUND"), 404
     else:
         mapped_result = []
         for r in result:
             mapped_result.append(buildDict.build_groupchats_dict(self, r))
         return jsonify(GroupChats=mapped_result)
Exemplo n.º 5
0
 def availableGroupChats(self, uid):
     values = GroupChatsDAO().availableGroupChats(uid)
     mapped_result = []
     for r in values:
         mapped_result.append(buildDict.build_groupchats_dict(self, r))
     return jsonify(GroupChats=mapped_result), 201