-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 번쩍 모임 생성 시 모임 정보를 먼저 저장하도록 변경 완료 (#538)
* refactor: meetingId 추가 * feat: 번쩍 모임 생성을 위해 모임 정보를 생성하는 createMeetingForLightning 메서드 추가 * feat: 번쩍 생성 시 최소한의 모임 정보를 생성하는 정적 팩토리 메서드 추가 * feat: 번쩍 모임 에러 코드 추가 * feat: 번쩍 모임 생성 시 기본 이미지 설정을 위한 Config 클래스 추가 * chore: yml에 이미지 환경변수 추가 * feat: 모임 id와 번쩍 생성 시 필요한 필드를 함께 포함한 DTO 생성 * refactor: 모임 정보를 먼저 생성하고 번쩍 정보를 생성하도록 변경 * refactor: 매퍼 매핑 로직 변경 * refactor: InStream을 사용하도록 변경 * chore: 404 예외 분리
- Loading branch information
1 parent
66fdcb3
commit e53c032
Showing
14 changed files
with
299 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
main/src/main/java/org/sopt/makers/crew/main/global/config/ImageSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.sopt.makers.crew.main.global.config; | ||
|
||
public interface ImageSetting { | ||
String getDefaultLightningImage(); | ||
} |
15 changes: 15 additions & 0 deletions
15
main/src/main/java/org/sopt/makers/crew/main/global/config/ImageSettingConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.sopt.makers.crew.main.global.config; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class ImageSettingConfig implements ImageSetting { | ||
@Value("${img.lightning}") | ||
private String defaultLightningImage; | ||
|
||
@Override | ||
public String getDefaultLightningImage() { | ||
return defaultLightningImage; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...kers/crew/main/meeting/v2/dto/response/MeetingV2CreateMeetingForLightningResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package org.sopt.makers.crew.main.meeting.v2.dto.response; | ||
|
||
import java.util.List; | ||
|
||
import org.sopt.makers.crew.main.lightning.v2.dto.request.LightningV2CreateLightningBodyWithoutWelcomeMessageDto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.Max; | ||
import jakarta.validation.constraints.Min; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Size; | ||
|
||
@Schema(name = "MeetingV2CreateMeetingForLightningResponseDto", description = "번쩍 모임 생성 및 수정 request body dto") | ||
public record MeetingV2CreateMeetingForLightningResponseDto( | ||
@Schema(description = "모임 id", example = "1") | ||
@NotNull | ||
Integer meetingId, | ||
|
||
@Schema(example = "알고보면 쓸데있는 개발 프로세스", description = "번쩍 모임 제목") | ||
@Size(min = 1, max = 30) | ||
@NotNull String title, | ||
|
||
@Schema(example = "api 가 터졌다고? 깃이 터졌다고?", description = "번쩍 소개") | ||
@Size(min = 1, max = 500) | ||
@NotNull | ||
String desc, | ||
|
||
@Schema(example = "예정 기간(협의 후 결정)", description = "번쩍 일정 결정 방식") | ||
@NotNull | ||
String lightningTimingType, | ||
|
||
@Schema(example = "2025.10.29", description = "번쩍 활동 시작 날짜", name = "activityStartDate") | ||
@NotNull | ||
String activityStartDate, | ||
|
||
@Schema(example = "2025.10.30", description = "번쩍 활동 종료 날짜", name = "activityEndDate") | ||
@NotNull | ||
String activityEndDate, | ||
|
||
@Schema(example = "오프라인", description = "모임 장소 Tag") | ||
@NotNull | ||
String lightningPlaceType, | ||
|
||
@Schema(example = "잠실역 5번 출구", description = "모임 장소") | ||
String lightningPlace, | ||
|
||
@Schema(example = "1", description = "최소 모집 인원") | ||
@Min(1) | ||
@NotNull | ||
Integer minimumCapacity, | ||
|
||
@Schema(example = "5", description = "최대 모집 인원") | ||
@Min(1) | ||
@Max(999) | ||
@NotNull | ||
Integer maximumCapacity, | ||
|
||
@Schema(example = "[\n" | ||
+ " \"https://makers-web-img.s3.ap-northeast-2.amazonaws.com/meeting/2023/04/12/7bd87736-b557-4b26-a0d5-9b09f1f1d7df\"\n" | ||
+ " ]", description = "모임 이미지 리스트, 최대 1개") | ||
@NotNull | ||
@Size(max = 1) | ||
List<String> files | ||
) { | ||
public static MeetingV2CreateMeetingForLightningResponseDto of( | ||
Integer meetingId, LightningV2CreateLightningBodyWithoutWelcomeMessageDto lightningBody) { | ||
return new MeetingV2CreateMeetingForLightningResponseDto( | ||
meetingId, | ||
lightningBody.title(), | ||
lightningBody.desc(), | ||
lightningBody.lightningTimingType(), | ||
lightningBody.activityStartDate(), | ||
lightningBody.activityEndDate(), | ||
lightningBody.lightningPlaceType(), | ||
lightningBody.lightningPlace(), | ||
lightningBody.minimumCapacity(), | ||
lightningBody.maximumCapacity(), | ||
lightningBody.files() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.