def get_player_matches(nickname):
    """Retrieve player matches from database."""
    page = request.args.get('page', 1, type=int)
    matches = Match.get_player_matches(nickname)

    response = paginate_response(matches, page)
    return jsonify(response), 200
def get_server_matches(endpoint):
    """Return all existing matches for a specify server."""
    page = request.args.get('page', 1, type=int)
    matches = Match.get_server_matches(endpoint)

    response = paginate_response(matches, page)
    return jsonify(response), 200
def get_players():
    """Return all existing players in database."""
    page = request.args.get('page', 1, type=int)
    order_by = request.args.get('order_by')
    players = Player.get_all(order_by=order_by)

    response = paginate_response(players, page=page)
    return jsonify(response), 200
def get_server_players(endpoint):
    """Return list of players on server."""
    page = request.args.get('page', 1, type=int)
    order_by = request.args.get('order_by')
    players = Player.get_all(order_by=order_by, endpoint=endpoint)

    response = paginate_response(players, page=page)
    return jsonify(response), 200
示例#5
0
def get_servers():
    """Retrieve all existing servers from database."""
    page = request.args.get('page', 1, type=int)
    order_by = request.args.get('order_by')
    servers = Server.get_all(order_by=order_by)

    response = paginate_response(servers, page)
    return jsonify(response), 200