feat: rework CatPreset for add more detail + add preset

This commit is contained in:
2026-01-21 22:05:58 +01:00
parent 78d22b466d
commit d2a7e6cbac
11 changed files with 440 additions and 158 deletions

View File

@@ -1,7 +1,6 @@
package fr.titionfire.ffsaf.rest.data;
import fr.titionfire.ffsaf.data.model.CatPresetModel;
import fr.titionfire.ffsaf.utils.Categorie;
import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -16,17 +15,15 @@ public class PresetData {
private String name;
private CatPresetModel.SwordType sword;
private CatPresetModel.ShieldType shield;
private List<Categorie> categories;
long roundDuration;
long pauseDuration;
int mandatoryProtection;
private List<CatPresetModel.CategorieEmbeddable> categories;
private int mandatoryProtection1;
private int mandatoryProtection2;
public static PresetData fromModel(CatPresetModel model) {
if (model == null)
return null;
return new PresetData(model.getId(), model.getName(), model.getSwordType(), model.getShieldType(),
model.getCategories(), model.getRoundDuration(), model.getPauseDuration(),
model.getMandatoryProtection());
model.getCategories(), model.getMandatoryProtection1(), model.getMandatoryProtection2());
}
}