def postReaction(message_id, user_id): handler = ReactionHandler() #pre: user exits and message exits #reaction must be either "like" or "dislike" #JSON FORMAT # # json = { "reaction": "like"} if request.method == 'POST': return handler.react( request.json, user_id, message_id ) # user giving like/dislike and message in which to react else: return jsonify(Error="Method not allowed"), 405
def dislikesCount(message_id): handler = ReactionHandler() return handler.getMessageDislikesCount(message_id)
def likes(message_id): handler = ReactionHandler() return handler.getMessageLikes(message_id)
def getReactionsByMessageID(message_id): handler = ReactionHandler() return handler.getReactionsByMessageID(message_id)
def getReactionsByID(user_id): handler = ReactionHandler() return handler.getReactionsByUserID(user_id)
def getReactions(): handler = ReactionHandler() return handler.getAllReactions()
def countDislikes(): handler = ReactionHandler() return handler.getDislikesPerDay()