Skip to content

Commit af7ecee

Browse files
authored
feat: Add problemId on GetSolutionResponse (#390)
1 parent 8748ebf commit af7ecee

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/java/com/gamzabat/algohub/feature/solution/dto/GetSolutionResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
@Getter
1212
public class GetSolutionResponse {
1313
private final Long solutionId;
14+
private final Long problemId;
1415
private final String problemTitle;
1516
private final Integer problemLevel;
1617
private final Integer accuracy;
@@ -32,6 +33,7 @@ public static GetSolutionResponse toDTO(Solution solution, Integer accuracy, Int
3233
Integer totalMemberCount, Long commentCount, Boolean isRead) {
3334
return GetSolutionResponse.builder()
3435
.solutionId(solution.getId())
36+
.problemId(solution.getProblem().getId())
3537
.problemTitle(solution.getProblem().getTitle())
3638
.problemLevel(solution.getProblem().getLevel())
3739
.accuracy(accuracy)

src/test/java/com/gamzabat/algohub/service/SolutionServiceTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ void getMySolutionsInGroupExpired() {
664664
assertThat(responses.getContent().get(i).getNickname()).isEqualTo("nickname1");
665665
assertThat(responses.getContent().get(i).getIsRead()).isEqualTo(false);
666666
assertThat(responses.getContent().get(i).getProblemLevel()).isEqualTo(problem1.getLevel());
667+
assertThat(responses.getContent().getFirst().getProblemId()).isEqualTo(problem1.getId());
667668
}
668669
}
669670

@@ -712,6 +713,7 @@ void getMySolutionsInProgress() {
712713
assertThat(responses.getContent().get(i).getIsRead()).isEqualTo(true);
713714
assertThat(responses.getContent().get(i).getGroupId()).isEqualTo(
714715
problem.getStudyGroup().getId());
716+
assertThat(responses.getContent().getFirst().getProblemId()).isEqualTo(problem1.getId());
715717
}
716718
}
717719

@@ -767,6 +769,7 @@ void getMySolutionsExpired() {
767769
assertThat(responses.getContent().get(i).getIsRead()).isEqualTo(false);
768770
assertThat(responses.getContent().get(i).getGroupId()).isEqualTo(
769771
problem2.getStudyGroup().getId());
772+
assertThat(responses.getContent().getFirst().getProblemId()).isEqualTo(problem1.getId());
770773
}
771774
}
772775

0 commit comments

Comments
 (0)