Пример #1
0
def reply():
    if request.method == 'POST':
        User.registerActivity()
        result = Post.reply(request.json)
        return result
    else:
        return jsonify(Error="Method not allowed"), 405
Пример #2
0
def createPost():
    if request.method == 'POST':
        if allowed_file(request.files['file'].filename):
            User.registerActivity()
            return Post.createPost(request.form, request.files['file'],
                                   app.config['UPLOAD_FOLDER'])
        return jsonify(Error="File extension not allowed"), 405
    return jsonify(Error="Method not allowed"), 405
Пример #3
0
def getUserContactsByID(user_id):
    if request.method == 'GET':
        result = User.getUserContactsByID(user_id)
        return result
    elif request.method == 'POST':
        result = User.addContacts(request.json)
        return result
    else:
        return jsonify(Error="Method not allowed"), 405
Пример #4
0
def getUserByID(user_id):
    if request.method == 'GET':
        result = User.getUserInfo(user_id)
        return result
    else:
        return jsonify(Error="Method not allowed"), 405
Пример #5
0
def getAllUsersNotSession():
    if request.method == 'GET':
        result = User.getAllUsersNotSession()
        return result
    else:
        return jsonify(Error="Method not allowed"), 405
Пример #6
0
def login():
    if request.method == 'POST':
        result = User.login(request.json)
        return result
    return jsonify(Error="Method not allowed."), 405
Пример #7
0
def register():
    if request.method == 'POST':
        return User.register(request.json)
    return jsonify(Error="Method not allowed."), 405
Пример #8
0
def createChat():
    if request.method == 'POST':
        User.registerActivity()
        return Chat.createChat(request.json)
    return jsonify(Error="Method not allowed."), 405
Пример #9
0
def getAllActivities():
    if request.method == 'GET':
        result = User.getAllActivity()
        return result
    else:
        return jsonify(Error="Method not allowed"), 405
Пример #10
0
def getCredentials():
    if request.method == 'GET':
        result = User.getAllCredentials()
        return result
    else:
        return jsonify(Error="Method not allowed"), 405
Пример #11
0
def getAdminByChatID(chat_id):
    if request.method == 'GET':
        result = User.getAdminByChatID(chat_id)
        return result
    else:
        return jsonify(Error="Method not allowed"), 405
Пример #12
0
def getUsersWhoDislikedPost(post_id):
    if request.method == 'GET':
        result = User.getUsersWhoDislikedPost(post_id)
        return result
    else:
        return jsonify(Error="Method not allowed"), 405
Пример #13
0
def getUserByUsername(username):
    if request.method == 'GET':
        result = User.getUserByUsername(username)
        return result
    else:
        return jsonify(Error="Method not allowed"), 405