diff --git a/faf-commons-api/src/main/java/com/faforever/commons/api/dto/License.java b/faf-commons-api/src/main/java/com/faforever/commons/api/dto/License.java new file mode 100644 index 00000000..f319b052 --- /dev/null +++ b/faf-commons-api/src/main/java/com/faforever/commons/api/dto/License.java @@ -0,0 +1,29 @@ +package com.faforever.commons.api.dto; + +import com.faforever.commons.api.elide.ElideEntity; +import com.github.jasminb.jsonapi.annotations.Id; +import com.github.jasminb.jsonapi.annotations.Type; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Data +@ToString(onlyExplicitlyIncluded = true) +@EqualsAndHashCode(onlyExplicitlyIncluded = true) +@Type("license") +public class License implements ElideEntity { + + @Id + @ToString.Include + @EqualsAndHashCode.Include + private String id; + private String name; + private String shortName; + private String url; + private String licenseText; + private boolean active; + private boolean revocable; + private boolean redistributable; + private boolean modifiable; +} + diff --git a/faf-commons-api/src/main/java/com/faforever/commons/api/dto/Map.java b/faf-commons-api/src/main/java/com/faforever/commons/api/dto/Map.java index 8ed90975..622ce071 100644 --- a/faf-commons-api/src/main/java/com/faforever/commons/api/dto/Map.java +++ b/faf-commons-api/src/main/java/com/faforever/commons/api/dto/Map.java @@ -39,4 +39,7 @@ public class Map extends AbstractEntity { @Relationship("reviewsSummary") private MapReviewsSummary mapReviewsSummary; + + @Relationship("license") + private License license; } diff --git a/faf-commons-api/src/main/java/com/faforever/commons/api/dto/Mod.java b/faf-commons-api/src/main/java/com/faforever/commons/api/dto/Mod.java index 03ab547d..b946024c 100644 --- a/faf-commons-api/src/main/java/com/faforever/commons/api/dto/Mod.java +++ b/faf-commons-api/src/main/java/com/faforever/commons/api/dto/Mod.java @@ -18,6 +18,7 @@ public class Mod extends AbstractEntity { private String displayName; @ToString.Include private String author; + private String repositoryUrl; @Relationship("uploader") @ToString.Include @@ -31,4 +32,7 @@ public class Mod extends AbstractEntity { @Relationship("reviewsSummary") private ModReviewsSummary modReviewsSummary; + + @Relationship("license") + private License license; } diff --git a/faf-commons-api/src/main/java/com/faforever/commons/api/dto/ReviewsSummary.java b/faf-commons-api/src/main/java/com/faforever/commons/api/dto/ReviewsSummary.java index 08ac3d36..7185d00d 100644 --- a/faf-commons-api/src/main/java/com/faforever/commons/api/dto/ReviewsSummary.java +++ b/faf-commons-api/src/main/java/com/faforever/commons/api/dto/ReviewsSummary.java @@ -5,6 +5,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +import org.jetbrains.annotations.Nullable; @Data @ToString(onlyExplicitlyIncluded = true) @@ -19,5 +20,6 @@ public class ReviewsSummary implements ElideEntity { private float score; private int reviews; private float lowerBound; - + @Nullable + private Float averageScore; }