Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: category 필드 추가 #491

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package org.sopt.makers.crew.main.internal.dto;

import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;

import org.sopt.makers.crew.main.entity.meeting.Meeting;
import org.sopt.makers.crew.main.entity.meeting.enums.EnMeetingStatus;
import org.sopt.makers.crew.main.entity.meeting.enums.MeetingJoinablePart;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

@Schema(name = "InternalMeetingResponseDto", description = "[Internal] 모임 조회 응답 Dto")
public record InternalMeetingResponseDto(
Expand All @@ -22,13 +27,24 @@ public record InternalMeetingResponseDto(
EnMeetingStatus status,
@Schema(description = "모임 이미지", example = "[url 형식]")
String imageUrl,
@Schema(description = "모임 분류, [스터디 or 행사 or 세미나]", example = "스터디", allowableValues = {"스터디", "행사", "세미나"})
@NotNull
String category,
@Schema(example = "[\n"
+ " \"ANDROID\",\n"
+ " \"IOS\"\n"
+ " ]", description = "대상 파트 목록")
@NotNull
@Size(min = 1, max = 6)
List<MeetingJoinablePart> joinableParts,
@Schema(description = "모임 차단 여부", example = "false")
boolean isBlockedMeeting
) {
public static InternalMeetingResponseDto of(Meeting meeting, LocalDateTime now, boolean isBlockedMeeting) {
return new InternalMeetingResponseDto(meeting.getId(), meeting.getTitle(),
meeting.getCanJoinOnlyActiveGeneration(), meeting.getMeetingStatus(now),
meeting.getImageURL().get(0).getUrl(),
meeting.getImageURL().get(0).getUrl(), meeting.getCategory().getValue(),
Arrays.stream(meeting.getJoinableParts()).toList(),
isBlockedMeeting);
}
}
Loading