|
6 | 6 | import classfit.example.classfit.scoreReport.domain.ScoreReport; |
7 | 7 | import classfit.example.classfit.student.domain.Student; |
8 | 8 | import jakarta.validation.constraints.NotNull; |
| 9 | +import org.springframework.format.annotation.DateTimeFormat; |
| 10 | + |
9 | 11 | import java.time.LocalDate; |
10 | 12 | import java.util.List; |
11 | | -import org.springframework.format.annotation.DateTimeFormat; |
12 | 13 |
|
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 | + ) { |
20 | 24 |
|
21 | | - public ScoreReport toEntity(SubClass subClass, MainClass mainClass,Student student, Member member) { |
| 25 | + public ScoreReport toEntity(SubClass subClass, MainClass mainClass, Student student, Member member) { |
22 | 26 | 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(); |
30 | 35 | } |
31 | 36 | } |
0 commit comments