Skip to content

Commit

Permalink
[modify] CrewPart를 추가해 joinableParts를 한글로 반환하도록 수정 (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
kseysh committed Nov 27, 2024
1 parent 0107699 commit 4c628e3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public record CrewMeeting(
MeetingStatus status,
String imageUrl,
String category,
List<String> joinableParts,
List<CrewPart> joinableParts,
Boolean isBlockedMeeting
){

Expand Down
18 changes: 18 additions & 0 deletions src/main/java/org/sopt/app/application/meeting/CrewPart.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.sopt.app.application.meeting;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum CrewPart {
PM("기획"),
DESIGN("디자인"),
WEB("웹"),
IOS("iOS"),
ANDROID("안드로이드"),
SERVER("서버")
;

private final String partName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ public static MeetingResponse of(final CrewMeeting crewMeeting) {
.title(crewMeeting.title())
.category(crewMeeting.category())
.canJoinOnlyActiveGeneration(crewMeeting.canJoinOnlyActiveGeneration())
.joinableParts(crewMeeting.joinableParts())
.joinableParts(convertToExposedPartName(crewMeeting.joinableParts()))
.canJoinAllParts(crewMeeting.joinableParts().size() == Part.values().length)
.status(crewMeeting.status())
.imageUrl(crewMeeting.imageUrl())
.build();
}

private static List<String> convertToExposedPartName(List<CrewPart> crewPart) {
return crewPart.stream().map(CrewPart::getPartName).toList();
}
}

0 comments on commit 4c628e3

Please sign in to comment.