Beispiel #1
0
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
Beispiel #2
0
def dislikesCount(message_id):
    handler = ReactionHandler()
    return handler.getMessageDislikesCount(message_id)
Beispiel #3
0
def likes(message_id):
    handler = ReactionHandler()
    return handler.getMessageLikes(message_id)
Beispiel #4
0
def getReactionsByMessageID(message_id):
    handler = ReactionHandler()
    return handler.getReactionsByMessageID(message_id)
Beispiel #5
0
def getReactionsByID(user_id):
    handler = ReactionHandler()
    return handler.getReactionsByUserID(user_id)
Beispiel #6
0
def getReactions():
    handler = ReactionHandler()
    return handler.getAllReactions()
Beispiel #7
0
def countDislikes():
    handler = ReactionHandler()
    return handler.getDislikesPerDay()