def postmessage(): handler = MessageHandler() if request.method == 'PUT': m = handler.postmessageh(request.json) return m[0] else: return jsonify(Error="Method not allowed."), 405
def putdislike(): handler = MessageHandler() if request.method == 'PUT': m = handler.disliked(request.json) print(m) return m[0] else: return jsonify(Error="Method not allowed."), 405
def messagebyid(mid): handler = MessageHandler() return handler.getMessageById(mid)
def allmessages(): handler = MessageHandler() return handler.getAllMessages()
def messagesInchat(cid): handler = MessageHandler() return handler.getMessagesFromChat(cid)
def getMessagesByUserId(uid): return MessageHandler().getMessagesFromUser(uid)
def getChatHash(cid, hashname): handler = MessageHandler() return handler.searchmsgwithhashinchat(cid, hashname)
def getdislikesinmessagenum(mid): handler = MessageHandler() return handler.getmessagedislikesCount(mid)
def getreplyinmessagenum(mid): handler = MessageHandler() return handler.getMessageRepliesCount(mid)
def getdislikesinmessage(mid): handler = MessageHandler() return handler.getmessagedislikes(mid)
def getreplyinmessage(mid): handler = MessageHandler() return handler.getMessageReplies(mid)
def getalllikes(): handler = MessageHandler() return handler.getalllikes()