Skip to content

Commit

Permalink
[hotfix] request dto 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
baekjaehyuk committed Jan 17, 2025
1 parent ffd9f12 commit badec13
Showing 1 changed file with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,31 @@
import classfit.example.classfit.scoreReport.domain.ScoreReport;
import classfit.example.classfit.student.domain.Student;
import jakarta.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;

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

public ScoreReport toEntity(SubClass subClass, MainClass mainClass,Student student, Member member) {
public ScoreReport toEntity(SubClass subClass, MainClass mainClass, Student student, Member member) {
return ScoreReport.builder()
.subClass(subClass)
.mainClass(mainClass)
.student(student)
.reportName(reportName)
.overallOpinion(overallOpinion)
.reportCreatedBy(member.getName())
.build();
.subClass(subClass)
.mainClass(mainClass)
.student(student)
.reportName(reportName)
.includeAverage(includeAverage)
.overallOpinion(overallOpinion)
.reportCreatedBy(member.getName())
.build();
}
}

0 comments on commit badec13

Please sign in to comment.