def addMessage(user_id, message): records = Consulta().addMessage(user_id, message) return str(records)
def getMessageByUserID(user_id): data = {user_id: Consulta().getMessageByUserID(user_id)} js = json.dumps(data) response = Response(response=js, status=200, mimetype='application/json') #return render_template('msgByUserID.html', msg=response) return response
def followed(follower): data = {follower: Consulta().getFollowed(follower)} js = json.dumps(data) response = Response(response=js, status=200, mimetype='application/json') return response
def messages(): records = Consulta().messages() return str(records)
def users(): records = Consulta().users() return records
def follows(): records = Consulta().follows() return str(records)
def unfollow(follower, followed): Consulta().unfollow(follower, followed) return ""
def follow(follower, followed): Consulta().follow(follower, followed) return ""
def remover(identificador): Consulta().remover(identificador) return ""
def cadastrar(login, name, bio): Consulta().cadastrar(login, name, bio) return "{0}".format(Consulta().getId(login, name, bio)[0])
def getuser(identificador): data = {identificador: Consulta().getUser(identificador)} js = json.dumps(data) response = Response(response=js, status=200, mimetype='application/json') return response