コード例 #1
0
def reactions(uid, cid, mid):
    if request.method == 'POST':
        return ReactionsHandler().insert_reaction(request.form, uid, mid)
    elif request.method == 'GET':
        return ReactionsHandler().getReactions()
    else:
        return jsonify(Error="Method not allowed"), 405
コード例 #2
0
def reactionsById(uid, cid, mid, rid):
    if request.method == 'GET':
        return ReactionsHandler().getReactionById(rid)
    elif request.method == 'PUT':
        return ReactionsHandler().updateReactionById(rid, request.form)
    elif request.method == 'DELETE':
        return ReactionsHandler().deleteReactionsById(rid)
    else:
        return jsonify(Error='Method Not Allowed'), 405
コード例 #3
0
def daily_dislikes():
    if request.method == 'GET':
        return ReactionsHandler().get_total_dislikes_per_day()
    else:
        return jsonify(Error='Method Not Allowed')
コード例 #4
0
def users_disliked(uid, cid, mid):
    if request.method == 'GET':
        return ReactionsHandler().get_users_that_disliked(mid)
    else:
        return jsonify(Error='Method Not Allowed'), 405
コード例 #5
0
def dislikes_by_mid(uid, cid, mid):
    if request.method == 'GET':
        return ReactionsHandler().get_number_of_dislikes(mid)
    else:
        return jsonify(Error='Method Not Allowed'), 405
コード例 #6
0
def total_message_dislikes(mid):
    if request.method == 'GET':
        return ReactionsHandler().get_number_of_dislikes(mid)
    else:
        return jsonify(Error='Method Not Allowed'), 405
コード例 #7
0
def reactions_by_id(mid, uid):
    if request.method == 'GET':
        return ReactionsHandler().get_user_reaction(mid, uid)
    else:
        return jsonify(Error="Method not allowed"), 405
コード例 #8
0
def allReactions():
    if request.method == 'POST':
        return ReactionsHandler().insertReactionToMsg(request.get_json())
    elif request.method == 'GET':
        if request.args:
            return ReactionsHandler().getAllReactionsFor(request.args)
コード例 #9
0
def allMessagesDislikes(mid):
    return ReactionsHandler().getAllMessageDislikes(mid)
コード例 #10
0
def allMessagesLikes(mid):
    return ReactionsHandler().getAllMessageLikes(mid)
コード例 #11
0
def numDislikesFromUser(id):
    return ReactionsHandler().getNumberOfDislikes(id)
コード例 #12
0
def dislikesFromUser(id):
    return ReactionsHandler().getAllUserDislikes(id)
コード例 #13
0
def likesFromUser(id):
    return ReactionsHandler().getAllUserLikes(id)