Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Dec 17, 2017
2 parents 7cdca8d + 6e27a3d commit 8ac82e8
Show file tree
Hide file tree
Showing 67 changed files with 3,748 additions and 697 deletions.
31 changes: 15 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/sonarIssues.xml

# Sensitive or high-churn files:
.idea/dataSources
.idea/dataSources.ids
.idea/dataSources.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
.idea/inspectionProfiles/
.idea/libraries
20 changes: 20 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ This application enables faforever.com moderators to perform administrative acti
1. Import the project into IntelliJ as "Maven Project"
1. Make sure you have the IntelliJ [Lombok plugin](https://plugins.jetbrains.com/idea/plugin/6317-lombok-plugin) installed
1. Make sure you have `Enable annotation processing` enabled in the settings
1. Add the dev profile as command line options ("VM options" in IntelliJ) using `-Dspring.profiles.active=dev`
1. Add the dev profile as command line options ("VM options" in IntelliJ) using `-Dspring.profiles.active=dev`
42 changes: 41 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.faforever</groupId>
<artifactId>faf-moderator-client</artifactId>
<version>0.1.2</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<name>faf-moderator-client</name>
Expand All @@ -22,6 +22,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>

<org.mapstruct.version>1.2.0.Final</org.mapstruct.version>
</properties>

<repositories>
Expand Down Expand Up @@ -86,6 +88,17 @@
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-jdk8</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -99,6 +112,33 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.18</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<compilerArg>
<!-- Note: add this to your IntelliJ compiler arguments -->
-Amapstruct.defaultComponentModel=jsr330
</compilerArg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.faforever.moderatorclient;

import com.faforever.moderatorclient.ui.MainController;
import com.faforever.moderatorclient.ui.StageHolder;
import com.faforever.moderatorclient.ui.UiService;
import com.faforever.moderatorclient.ui.*;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
Expand All @@ -12,6 +10,7 @@
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;

@SpringBootApplication(exclude = {
JmxAutoConfiguration.class,
Expand Down Expand Up @@ -44,4 +43,9 @@ public void start(Stage primaryStage) throws Exception {
primaryStage.setScene(new Scene(mainController.getRoot()));
primaryStage.show();
}

@Bean
public PlatformService platformService() {
return new PlatformServiceImpl(getHostServices());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class GamePlayerStats {
@Nullable
private OffsetDateTime scoreTime;

@Relationship("replay")
private Game replay;
@Relationship("game")
private Game game;

@Relationship("player")
private Player player;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/faforever/moderatorclient/api/dto/Map.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
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;
Expand Down Expand Up @@ -31,8 +32,10 @@ public class Map {
private MapStatistics statistics;

@Relationship("latestVersion")
@JsonIgnore
private MapVersion latestVersion;

@Relationship("versions")
@JsonIgnore
private List<MapVersion> versions;
}
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
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.apache.maven.artifact.versioning.ComparableVersion;
import org.jetbrains.annotations.Nullable;

import java.net.URL;
import java.time.OffsetDateTime;
import java.util.List;

@Getter
@Setter
@EqualsAndHashCode(of = "id")
@Type("mapVersion")
public class MapVersion {

@Id
private String id;
public class MapVersion extends AbstractEntity {
private String description;
private int maxPlayers;
private int width;
private int height;
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 OffsetDateTime createTime;
private OffsetDateTime updateTime;
private URL thumbnailUrlSmall;
private URL thumbnailUrlLarge;
private URL downloadUrl;
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/com/faforever/moderatorclient/api/dto/Player.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
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("player")
public class Player {
@Id
private String id;
public class Player extends AbstractEntity {
private String login;
@Relationship("names")
List<NameRecord> names;
Expand All @@ -28,8 +22,6 @@ public class Player {
private String steamId;
@RestrictedVisibility("IsModerator")
private String recentIpAddress;
private OffsetDateTime createTime;
private OffsetDateTime updateDateTime;

@Relationship("globalRating")
private GlobalRating globalRating;
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/com/faforever/moderatorclient/api/dto/UserNote.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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;
}
Loading

0 comments on commit 8ac82e8

Please sign in to comment.