[Added] Most of the frontend, split up backend services
This commit is contained in:
@@ -8,9 +8,11 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
public class Answers {
|
||||
private final String sessionId;
|
||||
private String sessionId;
|
||||
private List<String> answers;
|
||||
|
||||
public Answers() {}
|
||||
|
||||
public Answers(String sessionId) {
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ninjaws.quiz.models;
|
||||
|
||||
import com.ninjaws.quiz.models.QuizSettings.Category;
|
||||
import com.ninjaws.quiz.models.QuizSettings.Difficulty;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
@@ -54,6 +55,21 @@ public class QuizSettings {
|
||||
private Category category = Category.ANY;
|
||||
|
||||
|
||||
public QuizSettings(){}
|
||||
|
||||
/** Inverse of toApiQuery */
|
||||
public QuizSettings(int amount, Integer category, String difficulty, String type) {
|
||||
System.out.println(amount);
|
||||
System.out.print(category);
|
||||
System.out.print(difficulty);
|
||||
System.out.print(type);
|
||||
|
||||
this.amount = amount;
|
||||
this.category = category == null ? Category.ANY : Category.values()[category];
|
||||
this.difficulty = difficulty == null ? Difficulty.ANY : Difficulty.valueOf(difficulty.toUpperCase());
|
||||
this.type = type == null ? Type.ANY : type.equals("boolean") ? Type.BOOLEAN : Type.MULTIPLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures the value is between 1 and 50
|
||||
* @Valid doesn't seem to be enforcing it, so this ensures the value is legal
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
public class Session {
|
||||
private final String id;
|
||||
private int statusCode = 0;
|
||||
private List<Question> questions;
|
||||
|
||||
public Session() {
|
||||
|
||||
Reference in New Issue
Block a user