Skip to content

Commit

Permalink
refactor: 우수 스터디원이 없으면 null 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
kckc0608 committed Oct 6, 2024
1 parent 6098f3a commit d56b660
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.gdschongik.gdsc.domain.study.domain.StudyHistory;
import com.gdschongik.gdsc.domain.study.domain.StudyHistoryStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.ArrayList;
import jakarta.annotation.Nullable;
import java.util.List;

public record StudentMyCompleteStudyResponse(
Expand All @@ -19,7 +19,7 @@ public record StudentMyCompleteStudyResponse(
@Schema(description = "멘토 이름") String mentorName,
@Schema(description = "총 주차수") Long totalWeek,
@Schema(description = "수료 여부") StudyHistoryStatus studyHistoryStatus,
@Schema(description = "우수 스터디원 여부") List<AchievementType> achievements) {
@Nullable @Schema(description = "우수 스터디원 여부") List<AchievementType> achievements) {

public static StudentMyCompleteStudyResponse of(StudyHistory studyHistory, List<AchievementType> achievements) {
return new StudentMyCompleteStudyResponse(
Expand All @@ -33,6 +33,6 @@ public static StudentMyCompleteStudyResponse of(StudyHistory studyHistory, List<
studyHistory.getStudy().getMentor().getName(),
studyHistory.getStudy().getTotalWeek(),
studyHistory.getStudyHistoryStatus(),
(achievements == null) ? new ArrayList<>() : achievements);
achievements);
}
}

0 comments on commit d56b660

Please sign in to comment.