feat: add match eq support
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 6m42s

This commit is contained in:
2026-01-16 15:37:23 +01:00
parent 0150c4fac2
commit 01436ac220
7 changed files with 95 additions and 81 deletions

View File

@@ -11,6 +11,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -32,6 +33,7 @@ public class ResultCategoryData {
public static class RankArray {
int rank;
String name;
int score;
int win;
int pointMake;
int pointTake;
@@ -39,7 +41,8 @@ public class ResultCategoryData {
}
@RegisterForReflection
public record PouleArrayData(String red, boolean red_w, List<Integer[]> score, boolean blue_w, String blue, boolean end) {
public record PouleArrayData(String red, boolean red_w, List<Integer[]> score, boolean blue_w, String blue,
boolean eq, boolean end, Date date) {
public static PouleArrayData fromModel(MatchModel matchModel, MembreModel membreModel, ResultPrivacy privacy) {
return new PouleArrayData(
matchModel.getC1Name(membreModel, privacy),
@@ -49,7 +52,9 @@ public class ResultCategoryData {
: new ArrayList<>(),
matchModel.isEnd() && matchModel.win() < 0,
matchModel.getC2Name(membreModel, privacy),
matchModel.isEnd());
matchModel.isEnd() && matchModel.win() == 0,
matchModel.isEnd(),
matchModel.getDate());
}
}
@@ -57,7 +62,8 @@ public class ResultCategoryData {
public static record TreeData(long id, String c1FullName, String c2FullName, List<ScoreEmbeddable> scores,
boolean end) {
public static TreeData from(MatchModel match, MembreModel membreModel, ResultPrivacy privacy) {
return new TreeData(match.getId(), match.getC1Name(membreModel, privacy), match.getC2Name(membreModel, privacy), match.getScores(), match.isEnd());
return new TreeData(match.getId(), match.getC1Name(membreModel, privacy),
match.getC2Name(membreModel, privacy), match.getScores(), match.isEnd());
}
}
}