Skip to content

Commit

Permalink
Merge pull request #217 from Gongjakso/fix/apply
Browse files Browse the repository at this point in the history
fix: 파트 반환하도록 수정
  • Loading branch information
dl-00-e8 authored Sep 21, 2024
2 parents 31358bb + 127d7a1 commit 8a37e8e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.Builder;

import java.time.LocalDate;
import java.util.List;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -29,6 +30,9 @@ public record SimpleTeamRes(
@Schema(description = "팀 상태", example = "모집 중|모집 연장|모집 취소|모집 마감|활동 중|활동 종료")
String status,

@Schema(description = "지원 파트 정보 - 내가 지원한 팀에서는 지원한 포지션 하나만 반환")
List<String> recruitPart,

@Schema(description = "모집 마감일", example = "2024-12-31")
LocalDate recruitFinishedAt,

Expand All @@ -55,13 +59,18 @@ public static SimpleTeamRes of(Team team) {
dDay = (int) java.time.temporal.ChronoUnit.DAYS.between(LocalDate.now(), team.getRecruitFinishedAt());
}

List<String> recruitPartList = (team.getRecruitPart() != null) ? team.getRecruitPart().stream()
.map(recruitPart -> recruitPart.position().getKoreanName())
.toList() : null;

return SimpleTeamRes.builder()
.id(team.getId())
.title(team.getTitle())
.leaderId(team.getMember().getId())
.leaderName(team.getMember().getName())
.contestId(team.getContest().getId())
.status(team.getStatus().getDescription())
.recruitPart(recruitPartList)
.recruitFinishedAt(team.getRecruitFinishedAt())
.startedAt(team.getStartedAt())
.finishedAt(team.getFinishedAt())
Expand Down

0 comments on commit 8a37e8e

Please sign in to comment.