Skip to content

Commit

Permalink
feat: 과제 응답 DTO에 커리큘럼 시작일 추가 (#753)
Browse files Browse the repository at this point in the history
feat: 과제 응답 dto에 커리큘럼 시작일 추가
  • Loading branch information
Sangwook02 authored Sep 4, 2024
1 parent 6471966 commit bb700ff
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.gdschongik.gdsc.domain.study.domain.vo.Assignment;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.time.LocalTime;

public record AssignmentResponse(
Long studyDetailId,
Expand All @@ -13,7 +14,8 @@ public record AssignmentResponse(
@Schema(description = "마감 기한") LocalDateTime deadline,
@Schema(description = "주차") Long week,
@Schema(description = "과제 명세 링크") String descriptionLink,
@Schema(description = "과제 상태") StudyStatus assignmentStatus) {
@Schema(description = "과제 상태") StudyStatus assignmentStatus,
@Schema(description = "커리큘럼 시작일") LocalTime curriculumStartAt) {
public static AssignmentResponse from(StudyDetail studyDetail) {
Assignment assignment = studyDetail.getAssignment();
return new AssignmentResponse(
Expand All @@ -23,6 +25,7 @@ public static AssignmentResponse from(StudyDetail studyDetail) {
assignment.getDeadline(),
studyDetail.getWeek(),
assignment.getDescriptionLink(),
assignment.getStatus());
assignment.getStatus(),
studyDetail.getCurriculum().getStartAt());
}
}

0 comments on commit bb700ff

Please sign in to comment.