feat: move competition setting to ffsaf site
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package fr.titionfire.ffsaf.rest.data;
|
||||
|
||||
import fr.titionfire.ffsaf.data.model.CompetitionModel;
|
||||
import fr.titionfire.ffsaf.utils.CompetitionSystem;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class CompetitionData {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String uuid;
|
||||
private Date date;
|
||||
private CompetitionSystem system;
|
||||
private Long club;
|
||||
private String clubName;
|
||||
private String owner;
|
||||
|
||||
public static CompetitionData fromModel(CompetitionModel model) {
|
||||
if (model == null)
|
||||
return null;
|
||||
|
||||
return new CompetitionData(model.getId(), model.getName(), model.getUuid(), model.getDate(), model.getSystem(),
|
||||
model.getClub().getId(), model.getClub().getName(), model.getOwner());
|
||||
}
|
||||
}
|
||||
31
src/main/java/fr/titionfire/ffsaf/rest/data/MatchData.java
Normal file
31
src/main/java/fr/titionfire/ffsaf/rest/data/MatchData.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package fr.titionfire.ffsaf.rest.data;
|
||||
|
||||
import fr.titionfire.ffsaf.data.model.MatchModel;
|
||||
import fr.titionfire.ffsaf.utils.ScoreEmbeddable;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class MatchData {
|
||||
private Long id;
|
||||
private Long c1_id;
|
||||
private String c1_str;
|
||||
private Long c2_id;
|
||||
private String c2_str;
|
||||
private Long poule;
|
||||
private long poule_ord;
|
||||
private List<ScoreEmbeddable> scores;
|
||||
|
||||
public static MatchData fromModel(MatchModel model) {
|
||||
if (model == null)
|
||||
return null;
|
||||
|
||||
return new MatchData(model.getSystemId(), model.getC1_id().getId(), model.getC1_str(), model.getC2_id().getId(),
|
||||
model.getC2_str(), model.getPoule(), model.getPoule_ord(), model.getScores());
|
||||
}
|
||||
}
|
||||
23
src/main/java/fr/titionfire/ffsaf/rest/data/PouleData.java
Normal file
23
src/main/java/fr/titionfire/ffsaf/rest/data/PouleData.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package fr.titionfire.ffsaf.rest.data;
|
||||
|
||||
import fr.titionfire.ffsaf.data.model.PouleModel;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class PouleData {
|
||||
private Long id;
|
||||
private String name;
|
||||
private Long compet;
|
||||
private Integer type;
|
||||
|
||||
public static PouleData fromModel(PouleModel model) {
|
||||
if (model == null)
|
||||
return null;
|
||||
|
||||
return new PouleData(model.getSystemId(), model.getName(), model.getCompet().getId(), model.getType());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package fr.titionfire.ffsaf.rest.data;
|
||||
|
||||
import fr.titionfire.ffsaf.net2.data.SimpleCompet;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class SimpleCompetData {
|
||||
private long id;
|
||||
private boolean show_blason;
|
||||
private boolean show_flag;
|
||||
private List<String> admin;
|
||||
private List<String> table;
|
||||
|
||||
public static SimpleCompetData fromModel(SimpleCompet compet) {
|
||||
if (compet == null)
|
||||
return null;
|
||||
|
||||
return new SimpleCompetData(compet.id(), compet.show_blason(), compet.show_flag(),
|
||||
new ArrayList<>(), new ArrayList<>());
|
||||
}
|
||||
}
|
||||
28
src/main/java/fr/titionfire/ffsaf/rest/data/TreeData.java
Normal file
28
src/main/java/fr/titionfire/ffsaf/rest/data/TreeData.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package fr.titionfire.ffsaf.rest.data;
|
||||
|
||||
import fr.titionfire.ffsaf.data.model.TreeModel;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@RegisterForReflection
|
||||
public class TreeData {
|
||||
private Long id;
|
||||
private Long poule;
|
||||
private Integer level;
|
||||
private MatchData match;
|
||||
private TreeData left;
|
||||
private TreeData right;
|
||||
private TreeData associatedNode;
|
||||
|
||||
public static TreeData fromModel(TreeModel model) {
|
||||
if (model == null)
|
||||
return null;
|
||||
|
||||
return new TreeData(model.getId(), model.getPoule(), model.getLevel(), MatchData.fromModel(model.getMatch()),
|
||||
fromModel(model.getLeft()),
|
||||
fromModel(model.getRight()), null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user