Search in sources :

Example 1 with ExtensionsDto

use of com.djrapitops.plan.delivery.domain.datatransfer.extension.ExtensionsDto in project Plan by plan-player-analytics.

the class PlayerJSONCreator method playerExtensionData.

public List<ExtensionsDto> playerExtensionData(UUID playerUUID) {
    Database database = dbSystem.getDatabase();
    Map<ServerUUID, List<ExtensionData>> extensionPlayerData = database.query(new ExtensionPlayerDataQuery(playerUUID));
    Map<ServerUUID, Server> servers = database.query(ServerQueries.fetchPlanServerInformation());
    List<ExtensionsDto> playerData = new ArrayList<>();
    for (Map.Entry<ServerUUID, Server> entry : servers.entrySet()) {
        ServerUUID serverUUID = entry.getKey();
        playerData.add(new ExtensionsDto(playerUUID.toString(), serverUUID.toString(), entry.getValue().getIdentifiableName(), extensionPlayerData.getOrDefault(serverUUID, Collections.emptyList())));
    }
    return playerData;
}
Also used : ExtensionsDto(com.djrapitops.plan.delivery.domain.datatransfer.extension.ExtensionsDto) ServerUUID(com.djrapitops.plan.identification.ServerUUID) ExtensionPlayerDataQuery(com.djrapitops.plan.extension.implementation.storage.queries.ExtensionPlayerDataQuery) Server(com.djrapitops.plan.identification.Server) Database(com.djrapitops.plan.storage.database.Database)

Aggregations

ExtensionsDto (com.djrapitops.plan.delivery.domain.datatransfer.extension.ExtensionsDto)1 ExtensionPlayerDataQuery (com.djrapitops.plan.extension.implementation.storage.queries.ExtensionPlayerDataQuery)1 Server (com.djrapitops.plan.identification.Server)1 ServerUUID (com.djrapitops.plan.identification.ServerUUID)1 Database (com.djrapitops.plan.storage.database.Database)1