Skip to content

Commit badec13

Browse files
committed
[hotfix] request dto 오류 수정
1 parent ffd9f12 commit badec13

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

src/main/java/classfit/example/classfit/scoreReport/dto/request/CreateReportRequest.java

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,31 @@
66
import classfit.example.classfit.scoreReport.domain.ScoreReport;
77
import classfit.example.classfit.student.domain.Student;
88
import jakarta.validation.constraints.NotNull;
9+
import org.springframework.format.annotation.DateTimeFormat;
10+
911
import java.time.LocalDate;
1012
import java.util.List;
11-
import org.springframework.format.annotation.DateTimeFormat;
1213

13-
public record CreateReportRequest(Long mainClassId, Long subClassId, String reportName,
14-
boolean includeAverage,
15-
@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate,
16-
@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate,
17-
@NotNull(message = "시험 리스트를 선택해주세요.") List<Long> examIdList,
18-
@NotNull(message = "종합 의견을 입력해주세요.")
19-
String overallOpinion) {
14+
public record CreateReportRequest
15+
(
16+
Long mainClassId, Long subClassId, String reportName,
17+
Boolean includeAverage,
18+
@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate,
19+
@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate,
20+
@NotNull(message = "시험 리스트를 선택해주세요.") List<Long> examIdList,
21+
@NotNull(message = "종합 의견을 입력해주세요.")
22+
String overallOpinion
23+
) {
2024

21-
public ScoreReport toEntity(SubClass subClass, MainClass mainClass,Student student, Member member) {
25+
public ScoreReport toEntity(SubClass subClass, MainClass mainClass, Student student, Member member) {
2226
return ScoreReport.builder()
23-
.subClass(subClass)
24-
.mainClass(mainClass)
25-
.student(student)
26-
.reportName(reportName)
27-
.overallOpinion(overallOpinion)
28-
.reportCreatedBy(member.getName())
29-
.build();
27+
.subClass(subClass)
28+
.mainClass(mainClass)
29+
.student(student)
30+
.reportName(reportName)
31+
.includeAverage(includeAverage)
32+
.overallOpinion(overallOpinion)
33+
.reportCreatedBy(member.getName())
34+
.build();
3035
}
3136
}

0 commit comments

Comments
 (0)