diff --git a/pom.xml b/pom.xml
index d5976f7..09eb63f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
com.faforever
faf-moderator-client
- 0.2.0
+ 0.2.1
jar
faf-moderator-client
@@ -23,7 +23,15 @@
UTF-8
1.8
+ 6a78e08
+ 1.1
+ 1.6
+ 0.8
1.2.0.Final
+ 4.5.3
+ 2.8.8
+ 13.0
+ 1
@@ -37,7 +45,7 @@
org.jetbrains
annotations
- 13.0
+ ${org.jetbrains.annotations.version}
org.springframework.boot
@@ -50,37 +58,42 @@
javax.inject
javax.inject
- 1
+ ${javax.inject.version}
com.fasterxml.jackson.datatype
jackson-datatype-jsr310
- 2.8.8
+ ${com.fasterxml.jackson.datatype.version}
com.github.jasminb
jsonapi-converter
- 0.8
+ ${jitpack.jasminb.jsonapi-converter.version}
- com.github.FAForever
- faf-java-commons
- a53e12e
+ com.github.FAForever.faf-java-commons
+ faf-commons-data
+ ${jitpack.faf-java-commons.version}
+
+
+ com.github.FAForever.faf-java-commons
+ faf-commons-api
+ ${jitpack.faf-java-commons.version}
com.github.micheljung
nocatch
- 1.1
+ ${jitpack.nocatch.version}
org.apache.httpcomponents
httpclient
- 4.5.3
+ ${org.apache.httpcomponents.httpclient.version}
com.github.rutledgepaulv
q-builders
- 1.6
+ ${jitpack.q-builders.version}
diff --git a/src/main/java/com/faforever/moderatorclient/api/rest/ElideRouteBuilder.java b/src/main/java/com/faforever/moderatorclient/api/ElideRouteBuilder.java
similarity index 98%
rename from src/main/java/com/faforever/moderatorclient/api/rest/ElideRouteBuilder.java
rename to src/main/java/com/faforever/moderatorclient/api/ElideRouteBuilder.java
index f53c343..3d1afd9 100644
--- a/src/main/java/com/faforever/moderatorclient/api/rest/ElideRouteBuilder.java
+++ b/src/main/java/com/faforever/moderatorclient/api/ElideRouteBuilder.java
@@ -1,4 +1,4 @@
-package com.faforever.moderatorclient.api.rest;
+package com.faforever.moderatorclient.api;
import com.github.jasminb.jsonapi.annotations.Type;
import com.github.rutledgepaulv.qbuilders.builders.QBuilder;
diff --git a/src/main/java/com/faforever/moderatorclient/api/rest/FafApiCommunicationService.java b/src/main/java/com/faforever/moderatorclient/api/FafApiCommunicationService.java
similarity index 91%
rename from src/main/java/com/faforever/moderatorclient/api/rest/FafApiCommunicationService.java
rename to src/main/java/com/faforever/moderatorclient/api/FafApiCommunicationService.java
index 8486bbe..44764c0 100644
--- a/src/main/java/com/faforever/moderatorclient/api/rest/FafApiCommunicationService.java
+++ b/src/main/java/com/faforever/moderatorclient/api/FafApiCommunicationService.java
@@ -1,7 +1,8 @@
-package com.faforever.moderatorclient.api.rest;
+package com.faforever.moderatorclient.api;
-import com.faforever.moderatorclient.api.dto.LegacyAccessLevel;
-import com.faforever.moderatorclient.api.dto.Player;
+import com.faforever.commons.api.dto.LegacyAccessLevel;
+import com.faforever.commons.api.dto.Player;
+import com.faforever.moderatorclient.mapstruct.CycleAvoidingMappingContext;
import com.github.jasminb.jsonapi.JSONAPIDocument;
import com.github.jasminb.jsonapi.ResourceConverter;
import lombok.Getter;
@@ -34,6 +35,7 @@ public class FafApiCommunicationService {
private final ResourceConverter resourceConverter;
@Getter
private Player selfPlayer;
+ private final CycleAvoidingMappingContext cycleAvoidingMappingContext;
private final RestTemplateBuilder restTemplateBuilder;
private final HttpComponentsClientHttpRequestFactory requestFactory;
private final String apiClientId;
@@ -44,7 +46,7 @@ public class FafApiCommunicationService {
private RestOperations restOperations;
- public FafApiCommunicationService(ResourceConverter resourceConverter, RestTemplateBuilder restTemplateBuilder,
+ public FafApiCommunicationService(ResourceConverter resourceConverter, CycleAvoidingMappingContext cycleAvoidingMappingContext, RestTemplateBuilder restTemplateBuilder,
JsonApiMessageConverter jsonApiMessageConverter,
JsonApiErrorHandler jsonApiErrorHandler,
@Value("${faforever.api.base-url}")
@@ -60,6 +62,7 @@ public FafApiCommunicationService(ResourceConverter resourceConverter, RestTempl
) {
this.resourceConverter = resourceConverter;
+ this.cycleAvoidingMappingContext = cycleAvoidingMappingContext;
this.apiClientId = apiClientId;
this.apiClientSecret = apiClientSecret;
this.apiAccessTokenUrl = apiAccessTokenUrl;
@@ -105,25 +108,15 @@ public LegacyAccessLevel login(String username, String password) {
}
}
- @SneakyThrows
- public void post(ElideRouteBuilder> routeBuilder, Object request, boolean bufferRequestBody) {
- authorizedLatch.await();
- requestFactory.setBufferRequestBody(bufferRequestBody);
-
- try {
- // Don't use Void.class here, otherwise Spring won't even try to deserialize error messages in the body
- restOperations.postForEntity(routeBuilder.build(), request, String.class);
- } finally {
- requestFactory.setBufferRequestBody(true);
- }
- }
-
@SneakyThrows
public T post(ElideRouteBuilder routeBuilder, T object) {
authorizedLatch.await();
JSONAPIDocument data = new JSONAPIDocument<>(object);
String dataString = new String(resourceConverter.writeDocument(data));
ResponseEntity entity = restOperations.postForEntity(routeBuilder.build(), dataString, routeBuilder.getDtoClass());
+
+ cycleAvoidingMappingContext.clearCache();
+
return entity.getBody();
}
@@ -133,12 +126,16 @@ public Object postRelationship(ElideRouteBuilder> routeBuilder, Object object)
JSONAPIDocument> data = new JSONAPIDocument<>(object);
String dataString = new String(resourceConverter.writeDocument(data));
ResponseEntity> entity = restOperations.postForEntity(routeBuilder.build(), dataString, routeBuilder.getDtoClass());
+
+ cycleAvoidingMappingContext.clearCache();
+
return entity.getBody();
}
@SneakyThrows
public T patch(ElideRouteBuilder routeBuilder, T object) {
authorizedLatch.await();
+ cycleAvoidingMappingContext.clearCache();
return restOperations.patchForObject(routeBuilder.build(), object, routeBuilder.getDtoClass());
}
@@ -161,6 +158,7 @@ public T getOne(String endpointPath, Class type) {
@SuppressWarnings("unchecked")
@SneakyThrows
public T getOne(String endpointPath, Class type, java.util.Map params) {
+ cycleAvoidingMappingContext.clearCache();
return restOperations.getForObject(endpointPath, type, params);
}
@@ -199,6 +197,7 @@ public List getPage(ElideRouteBuilder routeBuilder, int pageSize, int
.pageSize(pageSize)
.pageNumber(page)
.build();
+ cycleAvoidingMappingContext.clearCache();
log.debug("Sending API request: {}", route);
return (List) restOperations.getForObject(
route,
diff --git a/src/main/java/com/faforever/moderatorclient/api/rest/JsonApiErrorHandler.java b/src/main/java/com/faforever/moderatorclient/api/JsonApiErrorHandler.java
similarity index 91%
rename from src/main/java/com/faforever/moderatorclient/api/rest/JsonApiErrorHandler.java
rename to src/main/java/com/faforever/moderatorclient/api/JsonApiErrorHandler.java
index 8f161a5..8cc56ab 100644
--- a/src/main/java/com/faforever/moderatorclient/api/rest/JsonApiErrorHandler.java
+++ b/src/main/java/com/faforever/moderatorclient/api/JsonApiErrorHandler.java
@@ -1,7 +1,7 @@
-package com.faforever.moderatorclient.api.rest;
+package com.faforever.moderatorclient.api;
-import com.faforever.moderatorclient.api.dto.ApiException;
+import com.faforever.commons.api.dto.ApiException;
import com.github.jasminb.jsonapi.exceptions.ResourceParseException;
import com.github.jasminb.jsonapi.models.errors.Errors;
import org.springframework.http.HttpStatus;
diff --git a/src/main/java/com/faforever/moderatorclient/api/rest/JsonApiMessageConverter.java b/src/main/java/com/faforever/moderatorclient/api/JsonApiMessageConverter.java
similarity index 97%
rename from src/main/java/com/faforever/moderatorclient/api/rest/JsonApiMessageConverter.java
rename to src/main/java/com/faforever/moderatorclient/api/JsonApiMessageConverter.java
index c0e54cc..470856a 100644
--- a/src/main/java/com/faforever/moderatorclient/api/rest/JsonApiMessageConverter.java
+++ b/src/main/java/com/faforever/moderatorclient/api/JsonApiMessageConverter.java
@@ -1,4 +1,4 @@
-package com.faforever.moderatorclient.api.rest;
+package com.faforever.moderatorclient.api;
import com.github.jasminb.jsonapi.JSONAPIDocument;
import com.github.jasminb.jsonapi.ReflectionUtils;
diff --git a/src/main/java/com/faforever/moderatorclient/api/rest/domain/AvatarService.java b/src/main/java/com/faforever/moderatorclient/api/domain/AvatarService.java
similarity index 89%
rename from src/main/java/com/faforever/moderatorclient/api/rest/domain/AvatarService.java
rename to src/main/java/com/faforever/moderatorclient/api/domain/AvatarService.java
index 50c6796..52f9aa8 100644
--- a/src/main/java/com/faforever/moderatorclient/api/rest/domain/AvatarService.java
+++ b/src/main/java/com/faforever/moderatorclient/api/domain/AvatarService.java
@@ -1,8 +1,8 @@
-package com.faforever.moderatorclient.api.rest.domain;
+package com.faforever.moderatorclient.api.domain;
-import com.faforever.moderatorclient.api.dto.Avatar;
-import com.faforever.moderatorclient.api.rest.ElideRouteBuilder;
-import com.faforever.moderatorclient.api.rest.FafApiCommunicationService;
+import com.faforever.commons.api.dto.Avatar;
+import com.faforever.moderatorclient.api.ElideRouteBuilder;
+import com.faforever.moderatorclient.api.FafApiCommunicationService;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
diff --git a/src/main/java/com/faforever/moderatorclient/api/rest/domain/DomainBlacklistService.java b/src/main/java/com/faforever/moderatorclient/api/domain/DomainBlacklistService.java
similarity index 79%
rename from src/main/java/com/faforever/moderatorclient/api/rest/domain/DomainBlacklistService.java
rename to src/main/java/com/faforever/moderatorclient/api/domain/DomainBlacklistService.java
index 05ac6a0..e373ea4 100644
--- a/src/main/java/com/faforever/moderatorclient/api/rest/domain/DomainBlacklistService.java
+++ b/src/main/java/com/faforever/moderatorclient/api/domain/DomainBlacklistService.java
@@ -1,8 +1,8 @@
-package com.faforever.moderatorclient.api.rest.domain;
+package com.faforever.moderatorclient.api.domain;
-import com.faforever.moderatorclient.api.dto.DomainBlacklist;
-import com.faforever.moderatorclient.api.rest.ElideRouteBuilder;
-import com.faforever.moderatorclient.api.rest.FafApiCommunicationService;
+import com.faforever.commons.api.dto.DomainBlacklist;
+import com.faforever.moderatorclient.api.ElideRouteBuilder;
+import com.faforever.moderatorclient.api.FafApiCommunicationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
diff --git a/src/main/java/com/faforever/moderatorclient/api/rest/domain/MapService.java b/src/main/java/com/faforever/moderatorclient/api/domain/MapService.java
similarity index 92%
rename from src/main/java/com/faforever/moderatorclient/api/rest/domain/MapService.java
rename to src/main/java/com/faforever/moderatorclient/api/domain/MapService.java
index ef2e3c4..291101c 100644
--- a/src/main/java/com/faforever/moderatorclient/api/rest/domain/MapService.java
+++ b/src/main/java/com/faforever/moderatorclient/api/domain/MapService.java
@@ -1,10 +1,10 @@
-package com.faforever.moderatorclient.api.rest.domain;
+package com.faforever.moderatorclient.api.domain;
-import com.faforever.moderatorclient.api.dto.Ladder1v1Map;
-import com.faforever.moderatorclient.api.dto.Map;
-import com.faforever.moderatorclient.api.dto.MapVersion;
-import com.faforever.moderatorclient.api.rest.ElideRouteBuilder;
-import com.faforever.moderatorclient.api.rest.FafApiCommunicationService;
+import com.faforever.commons.api.dto.Ladder1v1Map;
+import com.faforever.commons.api.dto.Map;
+import com.faforever.commons.api.dto.MapVersion;
+import com.faforever.moderatorclient.api.ElideRouteBuilder;
+import com.faforever.moderatorclient.api.FafApiCommunicationService;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
diff --git a/src/main/java/com/faforever/moderatorclient/api/rest/domain/UserService.java b/src/main/java/com/faforever/moderatorclient/api/domain/UserService.java
similarity index 72%
rename from src/main/java/com/faforever/moderatorclient/api/rest/domain/UserService.java
rename to src/main/java/com/faforever/moderatorclient/api/domain/UserService.java
index 09beb69..c605b34 100644
--- a/src/main/java/com/faforever/moderatorclient/api/rest/domain/UserService.java
+++ b/src/main/java/com/faforever/moderatorclient/api/domain/UserService.java
@@ -1,18 +1,14 @@
-package com.faforever.moderatorclient.api.rest.domain;
-
-import com.faforever.moderatorclient.api.dto.*;
-import com.faforever.moderatorclient.api.rest.ElideRouteBuilder;
-import com.faforever.moderatorclient.api.rest.FafApiCommunicationService;
-import com.faforever.moderatorclient.mapstruct.FeaturedModMapper;
-import com.faforever.moderatorclient.mapstruct.GamePlayerStatsMapper;
-import com.faforever.moderatorclient.mapstruct.UserNoteMapper;
-import com.faforever.moderatorclient.ui.domain.FeaturedModFX;
-import com.faforever.moderatorclient.ui.domain.UserNoteFX;
+package com.faforever.moderatorclient.api.domain;
+
+import com.faforever.commons.api.dto.*;
+import com.faforever.moderatorclient.api.ElideRouteBuilder;
+import com.faforever.moderatorclient.api.FafApiCommunicationService;
+import com.faforever.moderatorclient.mapstruct.*;
+import com.faforever.moderatorclient.ui.domain.*;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
-import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@@ -21,16 +17,24 @@
@Slf4j
public class UserService {
private final FafApiCommunicationService fafApi;
+ private final PlayerMapper playerMapper;
+ private final BanInfoMapper banInfoMapper;
+ private final BanRevokeDataMapper banRevokeDataMapper;
private final GamePlayerStatsMapper gamePlayerStatsMapper;
private final FeaturedModMapper featuredModMapper;
private final UserNoteMapper userNoteMapper;
+ private final TeamkillMapper teamkillMapper;
- public UserService(FafApiCommunicationService fafApi, GamePlayerStatsMapper gamePlayerStatsMapper, FeaturedModMapper featuredModMapper, UserNoteMapper userNoteMapper) {
+ public UserService(FafApiCommunicationService fafApi, PlayerMapper playerMapper, BanInfoMapper banInfoMapper, BanRevokeDataMapper banRevokeDataMapper, GamePlayerStatsMapper gamePlayerStatsMapper, FeaturedModMapper featuredModMapper, UserNoteMapper userNoteMapper, TeamkillMapper teamkillMapper) {
this.fafApi = fafApi;
+ this.playerMapper = playerMapper;
+ this.banInfoMapper = banInfoMapper;
+ this.banRevokeDataMapper = banRevokeDataMapper;
this.gamePlayerStatsMapper = gamePlayerStatsMapper;
this.featuredModMapper = featuredModMapper;
this.userNoteMapper = userNoteMapper;
+ this.teamkillMapper = teamkillMapper;
}
private ElideRouteBuilder addModeratorIncludes(@NotNull ElideRouteBuilder builder) {
@@ -52,10 +56,12 @@ private ElideRouteBuilder addModeratorIncludes(@NotNull ElideRouteBuilder builde
.addInclude(variablePrefix + "avatarAssignments")
.addInclude(variablePrefix + "avatarAssignments.avatar")
.addInclude(variablePrefix + "bans")
- .addInclude(variablePrefix + "bans.banRevokeData");
+ .addInclude(variablePrefix + "bans.author")
+ .addInclude(variablePrefix + "bans.banRevokeData")
+ .addInclude(variablePrefix + "bans.banRevokeData.author");
}
- public List findLatestRegistrations() {
+ public List findLatestRegistrations() {
log.debug("Searching for latest registrations");
ElideRouteBuilder routeBuilder = ElideRouteBuilder.of(Player.class)
.sort("id", false)
@@ -64,10 +70,10 @@ public List findLatestRegistrations() {
List result = fafApi.getPage(routeBuilder, 100, 1, Collections.emptyMap());
log.trace("found {} users", result.size());
- return result;
+ return playerMapper.mapToFx(result);
}
- private List findUsersByAttribute(@NotNull String attribute, @NotNull String pattern) {
+ private List findUsersByAttribute(@NotNull String attribute, @NotNull String pattern) {
log.debug("Searching for player by attribute '{}' with pattern: {}", attribute, pattern);
ElideRouteBuilder routeBuilder = ElideRouteBuilder.of(Player.class)
.filter(ElideRouteBuilder.qBuilder().string(attribute).eq(pattern));
@@ -75,30 +81,30 @@ private List findUsersByAttribute(@NotNull String attribute, @NotNull St
List result = fafApi.getAll(routeBuilder);
log.trace("found {} users", result.size());
- return result;
+ return playerMapper.mapToFx(result);
}
- public List findUserById(@NotNull String pattern) {
+ public List findUserById(@NotNull String pattern) {
return findUsersByAttribute("id", pattern);
}
- public List findUserByName(@NotNull String pattern) {
+ public List findUserByName(@NotNull String pattern) {
return findUsersByAttribute("login", pattern);
}
- public List findUserByEmail(@NotNull String pattern) {
+ public List findUserByEmail(@NotNull String pattern) {
return findUsersByAttribute("email", pattern);
}
- public List findUserBySteamId(@NotNull String pattern) {
+ public List findUserBySteamId(@NotNull String pattern) {
return findUsersByAttribute("steamId", pattern);
}
- public List findUserByIP(@NotNull String pattern) {
+ public List findUserByIP(@NotNull String pattern) {
return findUsersByAttribute("recentIpAddress", pattern);
}
- public Collection findUsersByPreviousName(@NotNull String pattern) {
+ public List findUsersByPreviousName(@NotNull String pattern) {
log.debug("Searching for player by previous name with pattern: {}", pattern);
ElideRouteBuilder routeBuilder = ElideRouteBuilder.of(NameRecord.class)
.addInclude("player")
@@ -109,10 +115,12 @@ public Collection findUsersByPreviousName(@NotNull String pattern) {
log.trace("found {} name records", result.size());
return result.stream()
.map(NameRecord::getPlayer)
- .collect(Collectors.toSet());
+ .distinct()
+ .map(playerMapper::map)
+ .collect(Collectors.toList());
}
- public List findLatestTeamkills() {
+ public List findLatestTeamkills() {
log.debug("Searching for latest teamkills ");
ElideRouteBuilder routeBuilder = ElideRouteBuilder.of(Teamkill.class)
.addInclude("teamkiller")
@@ -121,10 +129,10 @@ public List findLatestTeamkills() {
List result = fafApi.getPage(routeBuilder, 100, 1, Collections.emptyMap());
log.trace("found {} teamkills", result.size());
- return result;
+ return teamkillMapper.map(result);
}
- public List findTeamkillsByUserId(@NotNull String userId) {
+ public List findTeamkillsByUserId(@NotNull String userId) {
log.debug("Searching for teamkills invoked by player id: {}", userId);
ElideRouteBuilder routeBuilder = ElideRouteBuilder.of(Teamkill.class)
.addInclude("teamkiller")
@@ -133,15 +141,17 @@ public List findTeamkillsByUserId(@NotNull String userId) {
List result = fafApi.getAll(routeBuilder);
log.trace("found {} teamkills", result.size());
- return result;
+ return teamkillMapper.map(result);
}
- public BanInfo patchBanInfo(@NotNull BanInfo banInfo) {
+ public BanInfo patchBanInfo(@NotNull BanInfoFX banInfoFX) {
+ BanInfo banInfo = banInfoMapper.map(banInfoFX);
log.debug("Patching BanInfo of id: ", banInfo.getId());
return fafApi.patch(ElideRouteBuilder.of(BanInfo.class).id(banInfo.getId()), banInfo);
}
- public BanRevokeData revokeBan(@NotNull BanRevokeData banRevokeData) {
+ public BanRevokeData revokeBan(@NotNull BanRevokeDataFX banRevokeDataFX) {
+ BanRevokeData banRevokeData = banRevokeDataMapper.map(banRevokeDataFX);
log.debug("Revoking ban with id: ", banRevokeData.getBan().getId());
banRevokeData.setAuthor(fafApi.getSelfPlayer());
ElideRouteBuilder routeBuilder = ElideRouteBuilder.of(Player.class)
@@ -151,10 +161,11 @@ public BanRevokeData revokeBan(@NotNull BanRevokeData banRevokeData) {
return (BanRevokeData) fafApi.postRelationship(routeBuilder, banRevokeData);
}
- public BanInfo createBan(@NotNull BanInfo banInfo) {
+ public String createBan(@NotNull BanInfoFX banInfoFX) {
+ BanInfo banInfo = banInfoMapper.map(banInfoFX);
log.debug("Creating ban");
banInfo.setAuthor(fafApi.getSelfPlayer());
- return fafApi.post(ElideRouteBuilder.of(BanInfo.class), banInfo);
+ return fafApi.post(ElideRouteBuilder.of(BanInfo.class), banInfo).getId();
}
public List getLastHundredPlayedGamesByFeaturedMod(@NotNull String userId, int page, FeaturedModFX featuredModFX) {
@@ -213,4 +224,13 @@ public UserNoteFX patchUserNote(UserNote userNote) {
log.debug("Patching UserNote of id: ", userNote.getId());
return userNoteMapper.map(fafApi.patch(ElideRouteBuilder.of(UserNote.class).id(userNote.getId()), userNote));
}
+
+ public BanInfoFX getBanInfoById(String banInfoId) {
+ log.debug("Search for ban id: " + banInfoId);
+ ElideRouteBuilder routeBuilder = ElideRouteBuilder.of(BanInfo.class)
+ .id(banInfoId)
+ .addInclude("player")
+ .addInclude("author");
+ return banInfoMapper.map(fafApi.getOne(routeBuilder));
+ }
}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/AbstractEntity.java b/src/main/java/com/faforever/moderatorclient/api/dto/AbstractEntity.java
deleted file mode 100644
index fee1a55..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/AbstractEntity.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.time.OffsetDateTime;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-public abstract class AbstractEntity {
- @Id
- protected String id;
- protected OffsetDateTime createTime;
- protected OffsetDateTime updateTime;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/AchievementDefinition.java b/src/main/java/com/faforever/moderatorclient/api/dto/AchievementDefinition.java
deleted file mode 100644
index ef684f7..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/AchievementDefinition.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("achievement")
-public class AchievementDefinition {
-
- @Id
- private String id;
- private String description;
- private int experiencePoints;
- private AchievementState initialState;
- private String name;
- private String revealedIconUrl;
- private Integer totalSteps;
- private AchievementType type;
- private String unlockedIconUrl;
- private int order;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/AchievementState.java b/src/main/java/com/faforever/moderatorclient/api/dto/AchievementState.java
deleted file mode 100644
index 149a2d2..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/AchievementState.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-
-public enum AchievementState {
- HIDDEN,
- REVEALED,
- UNLOCKED
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/AchievementType.java b/src/main/java/com/faforever/moderatorclient/api/dto/AchievementType.java
deleted file mode 100644
index f97f5ed..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/AchievementType.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-public enum AchievementType {
- STANDARD,
- INCREMENTAL
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/ApiException.java b/src/main/java/com/faforever/moderatorclient/api/dto/ApiException.java
deleted file mode 100644
index 80f39ea..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/ApiException.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-
-import com.github.jasminb.jsonapi.models.errors.Error;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class ApiException extends RuntimeException {
-
- private final List errors;
-
- public ApiException(List errors) {
- this.errors = errors;
- }
-
- @Override
- public String getLocalizedMessage() {
- // TODO localize
- return errors.stream()
- .map(Error::getDetail)
- .collect(Collectors.joining("\n"));
- }
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Avatar.java b/src/main/java/com/faforever/moderatorclient/api/dto/Avatar.java
deleted file mode 100644
index f659ccb..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Avatar.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.List;
-
-@Type("avatar")
-@Getter
-@Setter
-public class Avatar extends AbstractEntity {
- private String url;
- private String tooltip;
- @Relationship("assignments")
- @JsonIgnore
- private List assignments;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/AvatarAssignment.java b/src/main/java/com/faforever/moderatorclient/api/dto/AvatarAssignment.java
deleted file mode 100644
index ffe6932..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/AvatarAssignment.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.time.OffsetDateTime;
-
-@Type("avatarAssignment")
-@Getter
-@Setter
-public class AvatarAssignment extends AbstractEntity {
- private boolean selected;
- private OffsetDateTime expiresAt;
- @Relationship("player")
- @JsonIgnore
- private Player player;
- @Relationship("avatar")
- @JsonIgnore
- private Avatar avatar;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/BanDurationType.java b/src/main/java/com/faforever/moderatorclient/api/dto/BanDurationType.java
deleted file mode 100644
index cf215ac..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/BanDurationType.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-public enum BanDurationType {
- PERMANENT, TEMPORARY
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/BanInfo.java b/src/main/java/com/faforever/moderatorclient/api/dto/BanInfo.java
deleted file mode 100644
index 4a96ad2..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/BanInfo.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.time.OffsetDateTime;
-
-@Type("banInfo")
-@RestrictedVisibility("HasBanRead")
-@Getter
-@Setter
-public class BanInfo extends AbstractEntity {
- @Relationship("player")
- @JsonIgnore
- private Player player;
- @Relationship("author")
- @JsonIgnore
- private Player author;
- private String reason;
- private OffsetDateTime expiresAt;
- private BanLevel level;
- @Relationship("banRevokeData")
- @JsonIgnore
- private BanRevokeData banRevokeData;
-
- @JsonIgnore
- public BanDurationType getDuration() {
- return expiresAt == null ? BanDurationType.PERMANENT : BanDurationType.TEMPORARY;
- }
-
- @JsonIgnore
- public BanStatus getBanStatus() {
- if (banRevokeData != null) {
- return BanStatus.DISABLED;
- }
- if (getDuration() == BanDurationType.PERMANENT) {
- return BanStatus.BANNED;
- }
- return expiresAt.isAfter(OffsetDateTime.now())
- ? BanStatus.BANNED
- : BanStatus.EXPIRED;
- }
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/BanLevel.java b/src/main/java/com/faforever/moderatorclient/api/dto/BanLevel.java
deleted file mode 100644
index 83bead0..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/BanLevel.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-public enum BanLevel {
- CHAT, GLOBAL
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/BanRevokeData.java b/src/main/java/com/faforever/moderatorclient/api/dto/BanRevokeData.java
deleted file mode 100644
index e17435e..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/BanRevokeData.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-
-@Type("banRevokeData")
-@Getter
-@Setter
-@RestrictedVisibility("HasBanRead")
-public class BanRevokeData extends AbstractEntity {
- @Relationship("ban")
- @JsonIgnore
- private BanInfo ban;
- private String reason;
- @Relationship("author")
- @JsonIgnore
- private Player author;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/BanStatus.java b/src/main/java/com/faforever/moderatorclient/api/dto/BanStatus.java
deleted file mode 100644
index 52d2e0a..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/BanStatus.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-public enum BanStatus {
- BANNED, DISABLED, EXPIRED
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Clan.java b/src/main/java/com/faforever/moderatorclient/api/dto/Clan.java
deleted file mode 100644
index 9cd642b..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Clan.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Data;
-
-import java.time.OffsetDateTime;
-import java.util.List;
-
-@Data
-@Type("clan")
-public class Clan {
- @Id
- private String id;
- private String name;
- private String tag;
- private String description;
- private String tagColor;
- private String websiteUrl;
- private OffsetDateTime createTime;
- private OffsetDateTime updateTime;
-
- @Relationship("founder")
- private Player founder;
-
- @Relationship("leader")
- private Player leader;
-
- @Relationship("memberships")
- private List memberships;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/ClanMembership.java b/src/main/java/com/faforever/moderatorclient/api/dto/ClanMembership.java
deleted file mode 100644
index bc797bb..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/ClanMembership.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Data;
-
-import java.time.OffsetDateTime;
-
-@Data
-@Type("clanMembership")
-public class ClanMembership {
- @Id
- private String id;
- private OffsetDateTime createTime;
- private OffsetDateTime updateTime;
-
- @Relationship("clan")
- private Clan clan;
-
- @Relationship("player")
- private Player player;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/CoopMission.java b/src/main/java/com/faforever/moderatorclient/api/dto/CoopMission.java
deleted file mode 100644
index 43daf8d..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/CoopMission.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("coopMission")
-public class CoopMission {
- @Id
- private String id;
- private String name;
- private int version;
- private String category;
- private String thumbnailUrlSmall;
- private String thumbnailUrlLarge;
- private String description;
- private String downloadUrl;
- private String folderName;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/CoopResult.java b/src/main/java/com/faforever/moderatorclient/api/dto/CoopResult.java
deleted file mode 100644
index 0043837..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/CoopResult.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.time.Duration;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("coopResult")
-public class CoopResult {
- @Id
- private String id;
- private Duration duration;
- private String playerNames;
- private boolean secondaryObjectives;
- private int ranking;
- private int playerCount;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/DomainBlacklist.java b/src/main/java/com/faforever/moderatorclient/api/dto/DomainBlacklist.java
deleted file mode 100644
index ac21d4e..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/DomainBlacklist.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@RestrictedVisibility("IsModerator")
-@Getter
-@Setter
-@EqualsAndHashCode(of = "domain")
-@Type("domainBlacklist")
-public class DomainBlacklist {
- @Id
- String domain;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Event.java b/src/main/java/com/faforever/moderatorclient/api/dto/Event.java
deleted file mode 100644
index aaebe76..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Event.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("event")
-public class Event {
-
- @Id
- private String id;
- private String name;
- private String imageUrl;
- private Type type;
-
- public enum Type {
- NUMERIC, TIME
- }
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Faction.java b/src/main/java/com/faforever/moderatorclient/api/dto/Faction.java
deleted file mode 100644
index baad1dc..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Faction.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@Slf4j
-@Getter
-@AllArgsConstructor
-public enum Faction {
- // Order is crucial
- AEON("aeon"),
- CYBRAN("cybran"),
- UEF("uef"),
- SERAPHIM("seraphim"),
- NOMAD("nomad"),
- CIVILIAN("civilian");
-
- private static final Map fromString;
-
- static {
- fromString = new HashMap<>();
- for (Faction faction : values()) {
- fromString.put(faction.string, faction);
- }
- }
-
- private final String string;
-
- @JsonCreator
- public static Faction fromFaValue(int value) {
- return Faction.values()[value - 1];
- }
-
- public static Faction fromString(String string) {
- return fromString.get(string);
- }
-
- /**
- * Returns the faction value used as in "Forged Alliance Forever".
- */
- @JsonValue
- public int toFaValue() {
- return ordinal() + 1;
- }
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/FeaturedMod.java b/src/main/java/com/faforever/moderatorclient/api/dto/FeaturedMod.java
deleted file mode 100644
index 36d881a..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/FeaturedMod.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("featuredMod")
-public class FeaturedMod {
- @Id
- private String id;
- private String description;
- private String displayName;
- private int order;
- private String gitBranch;
- private String gitUrl;
- private String bireusUrl;
- private String technicalName;
- private boolean visible;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/FeaturedModFile.java b/src/main/java/com/faforever/moderatorclient/api/dto/FeaturedModFile.java
deleted file mode 100644
index 14bdd13..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/FeaturedModFile.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("featuredModFile")
-public class FeaturedModFile {
- @Id
- private String id;
- private String version;
- private String group;
- private String name;
- private String md5;
- private String url;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Game.java b/src/main/java/com/faforever/moderatorclient/api/dto/Game.java
deleted file mode 100644
index d955fc9..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Game.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.time.OffsetDateTime;
-import java.util.List;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("game")
-public class Game {
- @Id
- private String id;
- private String name;
- private OffsetDateTime startTime;
- private OffsetDateTime endTime;
- private Validity validity;
- private VictoryCondition victoryCondition;
-
- @Relationship("reviews")
- private List reviews;
-
- @Relationship("playerStats")
- private List playerStats;
-
- @Relationship("host")
- private Player host;
-
- @Relationship("featuredMod")
- private FeaturedMod featuredMod;
-
- @Relationship("mapVersion")
- private MapVersion mapVersion;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/GamePlayerStats.java b/src/main/java/com/faforever/moderatorclient/api/dto/GamePlayerStats.java
deleted file mode 100644
index 4636794..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/GamePlayerStats.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import org.jetbrains.annotations.Nullable;
-
-import java.time.OffsetDateTime;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("gamePlayerStats")
-public class GamePlayerStats {
- @Id
- private String id;
- private boolean ai;
- private Faction faction;
- private byte color;
- private byte team;
- private byte startSpot;
- private Float beforeMean;
- private Float beforeDeviation;
- private Float afterMean;
- private Float afterDeviation;
- private byte score;
- @Nullable
- private OffsetDateTime scoreTime;
-
- @Relationship("game")
- private Game game;
-
- @Relationship("player")
- private Player player;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/GameReview.java b/src/main/java/com/faforever/moderatorclient/api/dto/GameReview.java
deleted file mode 100644
index c9264a9..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/GameReview.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@Type("gameReview")
-public class GameReview extends Review {
-
- @Relationship("game")
- private Game game;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/GlobalLeaderboardEntry.java b/src/main/java/com/faforever/moderatorclient/api/dto/GlobalLeaderboardEntry.java
deleted file mode 100644
index 40c7b24..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/GlobalLeaderboardEntry.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("globalLeaderboardEntry")
-public class GlobalLeaderboardEntry {
- @Id
- private String id;
- private String name;
- private int rank;
- private Double mean;
- private Double deviation;
- private Integer numGames;
- private Boolean isActive;
- private Double rating;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/GlobalRating.java b/src/main/java/com/faforever/moderatorclient/api/dto/GlobalRating.java
deleted file mode 100644
index ad51d21..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/GlobalRating.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Type;
-
-@Type("globalRating")
-public class GlobalRating extends Rating {
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Ladder1v1LeaderboardEntry.java b/src/main/java/com/faforever/moderatorclient/api/dto/Ladder1v1LeaderboardEntry.java
deleted file mode 100644
index 5596855..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Ladder1v1LeaderboardEntry.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("ladder1v1LeaderboardEntry")
-public class Ladder1v1LeaderboardEntry {
- @Id
- private String id;
- private int rank;
- private String name;
- private Double mean;
- private Double deviation;
- private Integer numGames;
- private Integer wonGames;
- private Boolean isActive;
- private Double rating;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Ladder1v1Map.java b/src/main/java/com/faforever/moderatorclient/api/dto/Ladder1v1Map.java
deleted file mode 100644
index a927dfd..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Ladder1v1Map.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("ladder1v1Map")
-public class Ladder1v1Map {
- @Id
- private String id;
- @Relationship("mapVersion")
- private MapVersion mapVersion;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Ladder1v1Rating.java b/src/main/java/com/faforever/moderatorclient/api/dto/Ladder1v1Rating.java
deleted file mode 100644
index cfd76df..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Ladder1v1Rating.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Type;
-
-@Type("ladder1v1Rating")
-public class Ladder1v1Rating extends Rating {
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/LegacyAccessLevel.java b/src/main/java/com/faforever/moderatorclient/api/dto/LegacyAccessLevel.java
deleted file mode 100644
index 3621307..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/LegacyAccessLevel.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import lombok.Getter;
-
-/**
- * @deprecated AccessLevel are going to be replaced with role based security
- */
-@Getter
-@Deprecated
-public enum LegacyAccessLevel {
- ROLE_USER,
- ROLE_MODERATOR,
- ROLE_ADMINISTRATOR
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/LobbyGroup.java b/src/main/java/com/faforever/moderatorclient/api/dto/LobbyGroup.java
deleted file mode 100644
index 18aa330..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/LobbyGroup.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-
-/**
- * @deprecated LobbyGroups are supposed to be replaced with role based security
- */
-@Getter
-@Deprecated
-@NoArgsConstructor
-@AllArgsConstructor
-@Type("lobbyGroup")
-public class LobbyGroup {
- @Id
- private String userId;
- private LegacyAccessLevel accessLevel;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Map.java b/src/main/java/com/faforever/moderatorclient/api/dto/Map.java
deleted file mode 100644
index bc27fd1..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Map.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.time.OffsetDateTime;
-import java.util.List;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("map")
-public class Map {
-
- @Id
- private String id;
- private String battleType;
- private OffsetDateTime createTime;
- private OffsetDateTime updateTime;
- private String displayName;
- private String mapType;
-
- @Relationship("author")
- private Player author;
-
- @Relationship("statistics")
- private MapStatistics statistics;
-
- @Relationship("latestVersion")
- @JsonIgnore
- private MapVersion latestVersion;
-
- @Relationship("versions")
- @JsonIgnore
- private List versions;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/MapStatistics.java b/src/main/java/com/faforever/moderatorclient/api/dto/MapStatistics.java
deleted file mode 100644
index 61e6426..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/MapStatistics.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("mapStatistics")
-public class MapStatistics {
- @Id
- private String id;
- private int downloads;
- private int draws;
- private int plays;
-
- @Relationship("map")
- private Map map;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/MapVersion.java b/src/main/java/com/faforever/moderatorclient/api/dto/MapVersion.java
deleted file mode 100644
index 6c29034..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/MapVersion.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.maven.artifact.versioning.ComparableVersion;
-import org.jetbrains.annotations.Nullable;
-
-import java.net.URL;
-import java.util.List;
-
-@Getter
-@Setter
-@Type("mapVersion")
-public class MapVersion extends AbstractEntity {
- private String description;
- private Integer maxPlayers;
- private Integer width;
- private Integer height;
- private ComparableVersion version;
- private String folderName;
- // TODO name consistently with folderName
- private String filename;
- private boolean ranked;
- private boolean hidden;
- private URL thumbnailUrlSmall;
- private URL thumbnailUrlLarge;
- private URL downloadUrl;
-
- @Relationship("map")
- private Map map;
-
- @Relationship("statistics")
- private MapVersionStatistics statistics;
-
- @Nullable
- @Relationship("ladder1v1Map")
- private Ladder1v1Map ladder1v1Map;
-
- @Relationship("reviews")
- private List reviews;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/MapVersionReview.java b/src/main/java/com/faforever/moderatorclient/api/dto/MapVersionReview.java
deleted file mode 100644
index 450aca8..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/MapVersionReview.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@Type("mapVersionReview")
-public class MapVersionReview extends Review {
-
- @Relationship("mapVersion")
- private MapVersion mapVersion;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/MapVersionStatistics.java b/src/main/java/com/faforever/moderatorclient/api/dto/MapVersionStatistics.java
deleted file mode 100644
index bd60217..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/MapVersionStatistics.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("mapVersionStatistics")
-public class MapVersionStatistics {
- @Id
- private String id;
- private int downloads;
- private int draws;
- private int plays;
-
- @Relationship("mapVersion")
- private MapVersion mapVersion;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Mod.java b/src/main/java/com/faforever/moderatorclient/api/dto/Mod.java
deleted file mode 100644
index 1519c8c..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Mod.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-import java.time.OffsetDateTime;
-import java.util.List;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("mod")
-@NoArgsConstructor
-public class Mod {
-
- @Id
- private String id;
- private String displayName;
- private String author;
- private OffsetDateTime createTime;
-
- @Relationship("versions")
- private List versions;
-
- @Relationship("latestVersion")
- private ModVersion latestVersion;
-
- public Mod(String id, String displayName, String author, OffsetDateTime createTime) {
- this.id = id;
- this.displayName = displayName;
- this.author = author;
- this.createTime = createTime;
- }
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/ModType.java b/src/main/java/com/faforever/moderatorclient/api/dto/ModType.java
deleted file mode 100644
index 1fafccf..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/ModType.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-public enum ModType {
- UI, SIM
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/ModVersion.java b/src/main/java/com/faforever/moderatorclient/api/dto/ModVersion.java
deleted file mode 100644
index 5954762..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/ModVersion.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.net.URL;
-import java.time.OffsetDateTime;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("modVersion")
-public class ModVersion {
-
- @Id
- private String id;
- private String uid;
- private ModType type;
- private String description;
- private short version;
- private String filename;
- private String icon;
- private boolean ranked;
- private boolean hidden;
- private OffsetDateTime createTime;
- private OffsetDateTime updateTime;
- private URL thumbnailUrl;
- private URL downloadUrl;
-
- @Relationship("mod")
- private Mod mod;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/ModVersionReview.java b/src/main/java/com/faforever/moderatorclient/api/dto/ModVersionReview.java
deleted file mode 100644
index 224a5f5..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/ModVersionReview.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@Type("modVersionReview")
-public class ModVersionReview extends Review {
-
- @Relationship("modVersion")
- private ModVersion modVersion;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/NameRecord.java b/src/main/java/com/faforever/moderatorclient/api/dto/NameRecord.java
deleted file mode 100644
index a8eff32..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/NameRecord.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-
-import java.time.OffsetDateTime;
-
-@Getter
-@Type("nameRecord")
-public class NameRecord {
- @Id
- private String id;
- private OffsetDateTime changeTime;
- @Relationship("player")
- private Player player;
- private String name;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Player.java b/src/main/java/com/faforever/moderatorclient/api/dto/Player.java
deleted file mode 100644
index aa666ba..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Player.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.List;
-
-@Getter
-@Setter
-@Type("player")
-public class Player extends AbstractEntity {
- private String login;
- @Relationship("names")
- List names;
- @RestrictedVisibility("IsModerator")
- private String email;
- private String userAgent;
- @RestrictedVisibility("IsModerator")
- private String steamId;
- @RestrictedVisibility("IsModerator")
- private String recentIpAddress;
-
- @Relationship("globalRating")
- private GlobalRating globalRating;
-
- @Relationship("ladder1v1Rating")
- private Ladder1v1Rating ladder1v1Rating;
-
- @Relationship("lobbyGroup")
- private LobbyGroup lobbyGroup;
-
- @Relationship("bans")
- private List bans;
-
- @Relationship("avatarAssignments")
- @JsonIgnore
- private List avatarAssignments;
-
- @Override
- public String toString() {
- return String.format("%s [id %s]", login, id);
- }
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/PlayerAchievement.java b/src/main/java/com/faforever/moderatorclient/api/dto/PlayerAchievement.java
deleted file mode 100644
index 9b43a26..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/PlayerAchievement.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Data;
-
-import java.time.Instant;
-
-@Data
-@Type("playerAchievement")
-public class PlayerAchievement {
-
- @Id
- private String id;
- private AchievementState state;
- private Integer currentSteps;
- private Instant createTime;
- private Instant updateTime;
-
- @Relationship("achievement")
- private AchievementDefinition achievement;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/PlayerEvent.java b/src/main/java/com/faforever/moderatorclient/api/dto/PlayerEvent.java
deleted file mode 100644
index 1abeb11..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/PlayerEvent.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-@Type("playerEvent")
-public class PlayerEvent {
-
- @Id
- private String id;
- private int count;
-
- @Relationship("event")
- private Event event;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Rating.java b/src/main/java/com/faforever/moderatorclient/api/dto/Rating.java
deleted file mode 100644
index d58f49c..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Rating.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-public class Rating {
- @Id
- private String id;
- private double mean;
- private double deviation;
- private double rating;
-
- @Relationship("player")
- private Player player;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/RestrictedVisibility.java b/src/main/java/com/faforever/moderatorclient/api/dto/RestrictedVisibility.java
deleted file mode 100644
index 9e44ec2..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/RestrictedVisibility.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that a class or class field is only visible for users with additional permissions
- */
-@Target({ElementType.TYPE, ElementType.FIELD})
-@Retention(RetentionPolicy.SOURCE)
-public @interface RestrictedVisibility {
- /**
- * @return an array of API permissions which are allowed to query this field
- */
- String[] value();
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Review.java b/src/main/java/com/faforever/moderatorclient/api/dto/Review.java
deleted file mode 100644
index 78d8e38..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Review.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.sql.Timestamp;
-
-@Getter
-@Setter
-@EqualsAndHashCode(of = "id")
-public class Review {
- @Id
- private String id;
- private String text;
- private Byte score;
- private Timestamp createTime;
- private Timestamp updateTime;
-
- @Relationship("player")
- private Player player;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Teamkill.java b/src/main/java/com/faforever/moderatorclient/api/dto/Teamkill.java
deleted file mode 100644
index e852ec6..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Teamkill.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Id;
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-
-import java.time.OffsetDateTime;
-
-@Getter
-@Type("teamkill")
-@RestrictedVisibility("IsModerator")
-public class Teamkill {
- @Id
- private String id;
- @Relationship("teamkiller")
- private Player teamkiller;
- @Relationship("victim")
- private Player victim;
- @Relationship("game")
- private Game game;
- private long gameTime;
- private OffsetDateTime reportedAt;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/UserNote.java b/src/main/java/com/faforever/moderatorclient/api/dto/UserNote.java
deleted file mode 100644
index dbbf110..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/UserNote.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import com.github.jasminb.jsonapi.annotations.Relationship;
-import com.github.jasminb.jsonapi.annotations.Type;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-@Type("userNote")
-@RestrictedVisibility("IsModerator")
-public class UserNote extends AbstractEntity {
- @Relationship("player")
- private Player player;
- @Relationship("author")
- private Player author;
- private boolean watched;
- private String note;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/Validity.java b/src/main/java/com/faforever/moderatorclient/api/dto/Validity.java
deleted file mode 100644
index f9d81f2..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/Validity.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-public enum Validity {
- // Order is crucial
- VALID,
- TOO_MANY_DESYNCS,
- WRONG_VICTORY_CONDITION,
- NO_FOG_OF_WAR,
- CHEATS_ENABLED,
- PREBUILT_ENABLED,
- NORUSH_ENABLED,
- BAD_UNIT_RESTRICTIONS,
- BAD_MAP,
- TOO_SHORT,
- BAD_MOD,
- COOP_NOT_RANKED,
- MUTUAL_DRAW,
- SINGLE_PLAYER,
- FFA_NOT_RANKED,
- UNEVEN_TEAMS_NOT_RANKED,
- UNKNOWN_RESULT;
-}
diff --git a/src/main/java/com/faforever/moderatorclient/api/dto/VictoryCondition.java b/src/main/java/com/faforever/moderatorclient/api/dto/VictoryCondition.java
deleted file mode 100644
index f2bf67a..0000000
--- a/src/main/java/com/faforever/moderatorclient/api/dto/VictoryCondition.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.faforever.moderatorclient.api.dto;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@Slf4j
-@Getter
-@AllArgsConstructor
-public enum VictoryCondition {
- // Order is crucial
- DEMORALIZATION(0),
- DOMINATION(1),
- ERADICATION(2),
- SANDBOX(3),
- UNKNOWN("unknown");
-
- private static final Map