From 659a6c52ca36e6560780c621bc12ba0a44fd56e9 Mon Sep 17 00:00:00 2001 From: "aj4941@naver.com" Date: Thu, 5 Oct 2023 15:55:45 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20=EC=B5=9C=EA=B7=BC=204=EA=B0=9C?= =?UTF-8?q?=EC=9D=98=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=A4=91=20=EC=A0=95?= =?UTF-8?q?=EB=8B=B5=20=EB=AC=B8=EC=A0=9C=20=EA=B0=9C=EC=88=98=20=EB=B0=98?= =?UTF-8?q?=ED=99=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../morandi/domain/testRecord/dto/TestRecordDto.java | 1 + .../morandi/domain/testRecord/mapper/TestRecordMapper.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/swm_nm/morandi/domain/testRecord/dto/TestRecordDto.java b/src/main/java/swm_nm/morandi/domain/testRecord/dto/TestRecordDto.java index 1ea932a7..5c8fdabe 100644 --- a/src/main/java/swm_nm/morandi/domain/testRecord/dto/TestRecordDto.java +++ b/src/main/java/swm_nm/morandi/domain/testRecord/dto/TestRecordDto.java @@ -25,6 +25,7 @@ public class TestRecordDto { private LocalDateTime testDate; private Long testTime; private Integer problemCount; + private Integer acceptCount; private DifficultyLevel startDifficulty; private DifficultyLevel endDifficulty; private String testTypename; diff --git a/src/main/java/swm_nm/morandi/domain/testRecord/mapper/TestRecordMapper.java b/src/main/java/swm_nm/morandi/domain/testRecord/mapper/TestRecordMapper.java index 59161ea2..405ced45 100644 --- a/src/main/java/swm_nm/morandi/domain/testRecord/mapper/TestRecordMapper.java +++ b/src/main/java/swm_nm/morandi/domain/testRecord/mapper/TestRecordMapper.java @@ -11,12 +11,17 @@ public class TestRecordMapper { public static TestRecordDto convertToDto(Tests test, List attemptProblemDtos) { - + Integer acceptCount = 0; + for (AttemptProblemDto attemptProblemDto : attemptProblemDtos) { + if (attemptProblemDto.getIsSolved()) + acceptCount++; + } TestRecordDto testRecordDto = TestRecordDto.builder() .testId(test.getTestId()) .testDate(test.getTestDate()) .testTime(test.getTestTime()) .problemCount(test.getProblemCount()) + .acceptCount(acceptCount) .startDifficulty(test.getStartDifficulty()) .endDifficulty(test.getEndDifficulty()) .testTypename(test.getTestTypename())