Skip to content

Commit

Permalink
feature :: add column to quiz result
Browse files Browse the repository at this point in the history
  • Loading branch information
miraexhoi committed Sep 23, 2024
1 parent c0e6c66 commit 0e4509a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/com/dnd/spaced/domain/quiz/domain/QuizResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import jakarta.persistence.Id;
import lombok.*;

import java.time.LocalDate;

@Entity
@Getter
@EqualsAndHashCode(of = "id")
Expand All @@ -17,6 +19,8 @@ public class QuizResult {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private Long accountId;

@ManyToOne
@JoinColumn(name = "quiz_question_id")
private QuizQuestion quizQuestion;
Expand All @@ -27,14 +31,20 @@ public class QuizResult {

private boolean isCorrect;

private LocalDate createdAt;

@Builder
private QuizResult(
QuizQuestion quizQuestion,
QuizOption selectedOption,
boolean isCorrect
boolean isCorrect,
Long accountId,
LocalDate createdAt
) {
this.quizQuestion = quizQuestion;
this.selectedOption = selectedOption;
this.isCorrect = isCorrect;
this.accountId = accountId;
this.createdAt = createdAt;
}
}

0 comments on commit 0e4509a

Please sign in to comment.