diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/Lightning.java b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/Flash.java similarity index 65% rename from main/src/main/java/org/sopt/makers/crew/main/entity/lightning/Lightning.java rename to main/src/main/java/org/sopt/makers/crew/main/entity/flash/Flash.java index 6b852110..0220113a 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/Lightning.java +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/Flash.java @@ -1,14 +1,14 @@ -package org.sopt.makers.crew.main.entity.lightning; +package org.sopt.makers.crew.main.entity.flash; import java.time.LocalDateTime; import java.util.List; import org.hibernate.annotations.Type; import org.sopt.makers.crew.main.entity.common.BaseTimeEntity; -import org.sopt.makers.crew.main.entity.lightning.converter.LightningPlaceTypeConverter; -import org.sopt.makers.crew.main.entity.lightning.converter.LightningTimingTypeConverter; -import org.sopt.makers.crew.main.entity.lightning.enums.LightningPlaceType; -import org.sopt.makers.crew.main.entity.lightning.enums.LightningTimingType; +import org.sopt.makers.crew.main.entity.flash.converter.FlashPlaceTypeConverter; +import org.sopt.makers.crew.main.entity.flash.converter.FlashTimingTypeConverter; +import org.sopt.makers.crew.main.entity.flash.enums.FlashPlaceType; +import org.sopt.makers.crew.main.entity.flash.enums.FlashTimingType; import org.sopt.makers.crew.main.entity.meeting.enums.EnMeetingStatus; import org.sopt.makers.crew.main.entity.meeting.vo.ImageUrlVO; @@ -30,8 +30,8 @@ @Entity @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) -@Table(name = "lightning") -public class Lightning extends BaseTimeEntity { +@Table(name = "flash") +public class Flash extends BaseTimeEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @@ -52,10 +52,10 @@ public class Lightning extends BaseTimeEntity { @Column(name = "desc", columnDefinition = "TEXT") private String desc; - @Column(name = "lightningTimingType") + @Column(name = "flashTimingType") @NotNull - @Convert(converter = LightningTimingTypeConverter.class) - private LightningTimingType lightningTimingType; + @Convert(converter = FlashTimingTypeConverter.class) + private FlashTimingType flashTimingType; @Column(name = "startDate") @NotNull @@ -73,13 +73,13 @@ public class Lightning extends BaseTimeEntity { @NotNull private LocalDateTime activityEndDate; - @Column(name = "lightningPlaceType") + @Column(name = "flashPlaceType") @NotNull - @Convert(converter = LightningPlaceTypeConverter.class) - private LightningPlaceType lightningPlaceType; + @Convert(converter = FlashPlaceTypeConverter.class) + private FlashPlaceType flashPlaceType; - @Column(name = "lightningPlace") - private String lightningPlace; + @Column(name = "flashPlace") + private String flashPlace; @Column(name = "minimumCapacity") @NotNull @@ -98,38 +98,38 @@ public class Lightning extends BaseTimeEntity { private List imageURL; @Builder - public Lightning(Integer leaderUserId, Integer meetingId, String title, String desc, - LightningTimingType lightningTimingType, + public Flash(Integer leaderUserId, Integer meetingId, String title, String desc, + FlashTimingType flashTimingType, LocalDateTime startDate, LocalDateTime endDate, - LocalDateTime activityStartDate, LocalDateTime activityEndDate, LightningPlaceType lightningPlaceType, - String lightningPlace, int minimumCapacity, int maximumCapacity, Integer createdGeneration, + LocalDateTime activityStartDate, LocalDateTime activityEndDate, FlashPlaceType flashPlaceType, + String flashPlace, int minimumCapacity, int maximumCapacity, Integer createdGeneration, List imageURL) { this.leaderUserId = leaderUserId; this.meetingId = meetingId; this.title = title; this.desc = desc; - this.lightningTimingType = lightningTimingType; + this.flashTimingType = flashTimingType; this.startDate = startDate; this.endDate = endDate; this.activityStartDate = activityStartDate; this.activityEndDate = activityEndDate; - this.lightningPlaceType = lightningPlaceType; - this.lightningPlace = lightningPlace; + this.flashPlaceType = flashPlaceType; + this.flashPlace = flashPlace; this.minimumCapacity = minimumCapacity; this.maximumCapacity = maximumCapacity; this.createdGeneration = createdGeneration; this.imageURL = imageURL; } - public boolean checkLightningMeetingLeader(Integer userId) { + public boolean checkFlashMeetingLeader(Integer userId) { return this.leaderUserId.equals(userId); } - public int getLightningMeetingStatusValue(LocalDateTime now) { - return getLightningMeetingStatus(now).getValue(); + public int getFlashMeetingStatusValue(LocalDateTime now) { + return getFlashMeetingStatus(now).getValue(); } - public EnMeetingStatus getLightningMeetingStatus(LocalDateTime now) { + public EnMeetingStatus getFlashMeetingStatus(LocalDateTime now) { if (now.isBefore(startDate)) { return EnMeetingStatus.BEFORE_START; } diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/flash/FlashRepository.java b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/FlashRepository.java new file mode 100644 index 00000000..7626dbb5 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/FlashRepository.java @@ -0,0 +1,9 @@ +package org.sopt.makers.crew.main.entity.flash; + +import java.util.Optional; + +import org.springframework.data.jpa.repository.JpaRepository; + +public interface FlashRepository extends JpaRepository { + Optional findByMeetingId(Integer meetingId); +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/flash/converter/FlashPlaceTypeConverter.java b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/converter/FlashPlaceTypeConverter.java new file mode 100644 index 00000000..6b9c5bc3 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/converter/FlashPlaceTypeConverter.java @@ -0,0 +1,20 @@ +package org.sopt.makers.crew.main.entity.flash.converter; + +import org.sopt.makers.crew.main.entity.flash.enums.FlashPlaceType; + +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; + +@Converter +public class FlashPlaceTypeConverter implements AttributeConverter { + + @Override + public String convertToDatabaseColumn(FlashPlaceType flashPlaceType) { + return flashPlaceType.getValue(); // FlashPlaceType의 값을 반환 + } + + @Override + public FlashPlaceType convertToEntityAttribute(String dbData) { + return FlashPlaceType.ofValue(dbData); // dbData에 해당하는 FlashPlaceType 객체를 반환 + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/flash/converter/FlashTimingTypeConverter.java b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/converter/FlashTimingTypeConverter.java new file mode 100644 index 00000000..be089689 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/converter/FlashTimingTypeConverter.java @@ -0,0 +1,20 @@ +package org.sopt.makers.crew.main.entity.flash.converter; + +import org.sopt.makers.crew.main.entity.flash.enums.FlashTimingType; + +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; + +@Converter +public class FlashTimingTypeConverter implements AttributeConverter { + + @Override + public String convertToDatabaseColumn(FlashTimingType flashTimingType) { + return flashTimingType.getValue(); // FlashTimingType의 값을 반환 + } + + @Override + public FlashTimingType convertToEntityAttribute(String dbData) { + return FlashTimingType.ofValue(dbData); // dbData에 해당하는 FlashTimingType 객체를 반환 + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/flash/enums/FlashPlaceType.java b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/enums/FlashPlaceType.java new file mode 100644 index 00000000..b9d75446 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/enums/FlashPlaceType.java @@ -0,0 +1,25 @@ +package org.sopt.makers.crew.main.entity.flash.enums; + +import lombok.Getter; + +@Getter +public enum FlashPlaceType { + OFFLINE("오프라인"), + ONLINE("온라인"), + AFTER_DISCUSSION("협의 후 결정"); + + private final String value; + + FlashPlaceType(String value) { + this.value = value; + } + + public static FlashPlaceType ofValue(String dbData) { + for (FlashPlaceType place : FlashPlaceType.values()) { + if (place.getValue().equals(dbData)) { + return place; + } + } + throw new IllegalArgumentException("Invalid FlashPlaceType value: " + dbData); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/flash/enums/FlashTimingType.java b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/enums/FlashTimingType.java new file mode 100644 index 00000000..808b8949 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/flash/enums/FlashTimingType.java @@ -0,0 +1,24 @@ +package org.sopt.makers.crew.main.entity.flash.enums; + +import lombok.Getter; + +@Getter +public enum FlashTimingType { + IMMEDIATE("당일"), + AFTER_DISCUSSION("예정 기간(협의 후 결정)"); + + private final String value; + + FlashTimingType(String value) { + this.value = value; + } + + public static FlashTimingType ofValue(String dbData) { + for (FlashTimingType timing : FlashTimingType.values()) { + if (timing.getValue().equals(dbData)) { + return timing; + } + } + throw new IllegalArgumentException("Invalid FlashTimingType value: " + dbData); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/LightningRepository.java b/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/LightningRepository.java deleted file mode 100644 index dd6fee97..00000000 --- a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/LightningRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.sopt.makers.crew.main.entity.lightning; - -import java.util.Optional; - -import org.springframework.data.jpa.repository.JpaRepository; - -public interface LightningRepository extends JpaRepository { - Optional findByMeetingId(Integer meetingId); -} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/converter/LightningPlaceTypeConverter.java b/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/converter/LightningPlaceTypeConverter.java deleted file mode 100644 index b82794ac..00000000 --- a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/converter/LightningPlaceTypeConverter.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.sopt.makers.crew.main.entity.lightning.converter; - -import org.sopt.makers.crew.main.entity.lightning.enums.LightningPlaceType; - -import jakarta.persistence.AttributeConverter; -import jakarta.persistence.Converter; - -@Converter -public class LightningPlaceTypeConverter implements AttributeConverter { - - @Override - public String convertToDatabaseColumn(LightningPlaceType lightningPlaceType) { - return lightningPlaceType.getValue(); // LightningPlaceType의 값을 반환 - } - - @Override - public LightningPlaceType convertToEntityAttribute(String dbData) { - return LightningPlaceType.ofValue(dbData); // dbData에 해당하는 LightningPlaceType 객체를 반환 - } -} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/converter/LightningTimingTypeConverter.java b/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/converter/LightningTimingTypeConverter.java deleted file mode 100644 index 7b33f456..00000000 --- a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/converter/LightningTimingTypeConverter.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.sopt.makers.crew.main.entity.lightning.converter; - -import org.sopt.makers.crew.main.entity.lightning.enums.LightningTimingType; - -import jakarta.persistence.AttributeConverter; -import jakarta.persistence.Converter; - -@Converter -public class LightningTimingTypeConverter implements AttributeConverter { - - @Override - public String convertToDatabaseColumn(LightningTimingType lightningTimingType) { - return lightningTimingType.getValue(); // LightningTimingType의 값을 반환 - } - - @Override - public LightningTimingType convertToEntityAttribute(String dbData) { - return LightningTimingType.ofValue(dbData); // dbData에 해당하는 LightningTimingType 객체를 반환 - } -} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/enums/LightningPlaceType.java b/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/enums/LightningPlaceType.java deleted file mode 100644 index 629a218f..00000000 --- a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/enums/LightningPlaceType.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.sopt.makers.crew.main.entity.lightning.enums; - -import lombok.Getter; - -@Getter -public enum LightningPlaceType { - OFFLINE("오프라인"), - ONLINE("온라인"), - AFTER_DISCUSSION("협의 후 결정"); - - private final String value; - - LightningPlaceType(String value) { - this.value = value; - } - - public static LightningPlaceType ofValue(String dbData) { - for (LightningPlaceType place : LightningPlaceType.values()) { - if (place.getValue().equals(dbData)) { - return place; - } - } - throw new IllegalArgumentException("Invalid LightningPlaceType value: " + dbData); - } -} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/enums/LightningTimingType.java b/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/enums/LightningTimingType.java deleted file mode 100644 index 1d7770ce..00000000 --- a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/enums/LightningTimingType.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.sopt.makers.crew.main.entity.lightning.enums; - -import lombok.Getter; - -@Getter -public enum LightningTimingType { - IMMEDIATE("당일"), - AFTER_DISCUSSION("예정 기간(협의 후 결정)"); - - private final String value; - - LightningTimingType(String value) { - this.value = value; - } - - public static LightningTimingType ofValue(String dbData) { - for (LightningTimingType timing : LightningTimingType.values()) { - if (timing.getValue().equals(dbData)) { - return timing; - } - } - throw new IllegalArgumentException("Invalid LightningTimingType value: " + dbData); - } -} diff --git a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/LightningV2Api.java b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/FlashV2Api.java similarity index 61% rename from main/src/main/java/org/sopt/makers/crew/main/lightning/v2/LightningV2Api.java rename to main/src/main/java/org/sopt/makers/crew/main/flash/v2/FlashV2Api.java index 4fcdd87b..a2c8d00c 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/LightningV2Api.java +++ b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/FlashV2Api.java @@ -1,10 +1,10 @@ -package org.sopt.makers.crew.main.lightning.v2; +package org.sopt.makers.crew.main.flash.v2; import java.security.Principal; -import org.sopt.makers.crew.main.lightning.v2.dto.request.LightningV2CreateLightningBodyDto; -import org.sopt.makers.crew.main.lightning.v2.dto.response.LightningV2CreateLightningResponseDto; -import org.sopt.makers.crew.main.lightning.v2.dto.response.LightningV2GetLightningByMeetingIdResponseDto; +import org.sopt.makers.crew.main.flash.v2.dto.request.FlashV2CreateFlashBodyDto; +import org.sopt.makers.crew.main.flash.v2.dto.response.FlashV2CreateFlashResponseDto; +import org.sopt.makers.crew.main.flash.v2.dto.response.FlashV2GetFlashByMeetingIdResponseDto; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -17,15 +17,15 @@ import jakarta.validation.Valid; @Tag(name = "번쩍 모임") -public interface LightningV2Api { +public interface FlashV2Api { @Operation(summary = "번쩍 모임 생성") @ApiResponses(value = { - @ApiResponse(responseCode = "201", description = "lightningId: 10"), + @ApiResponse(responseCode = "201", description = "meetingId: 10"), @ApiResponse(responseCode = "400", description = "VALIDATION_EXCEPTION", content = @Content), }) - ResponseEntity createLightning( - @Valid @RequestBody LightningV2CreateLightningBodyDto requestBody, + ResponseEntity createFlash( + @Valid @RequestBody FlashV2CreateFlashBodyDto requestBody, Principal principal); @Operation(summary = "번쩍 모임 상세 조회") @@ -33,7 +33,7 @@ ResponseEntity createLightning( @ApiResponse(responseCode = "200", description = "번쩍 모임 상세 조회 성공"), @ApiResponse(responseCode = "400", description = "번쩍 모임이 없습니다.", content = @Content), }) - ResponseEntity getLightningByMeetingId( + ResponseEntity getFlashByMeetingId( @PathVariable Integer meetingId, Principal principal); } diff --git a/main/src/main/java/org/sopt/makers/crew/main/flash/v2/FlashV2Controller.java b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/FlashV2Controller.java new file mode 100644 index 00000000..3af7111e --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/FlashV2Controller.java @@ -0,0 +1,48 @@ +package org.sopt.makers.crew.main.flash.v2; + +import java.security.Principal; + +import org.sopt.makers.crew.main.flash.v2.dto.request.FlashV2CreateFlashBodyDto; +import org.sopt.makers.crew.main.flash.v2.dto.response.FlashV2CreateFlashResponseDto; +import org.sopt.makers.crew.main.flash.v2.dto.response.FlashV2GetFlashByMeetingIdResponseDto; +import org.sopt.makers.crew.main.flash.v2.service.FlashV2Service; +import org.sopt.makers.crew.main.global.util.UserUtil; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; + +@RestController +@RequestMapping("/flash/v2") +@RequiredArgsConstructor +public class FlashV2Controller implements FlashV2Api { + private final FlashV2Service flashV2Service; + + @Override + @PostMapping + public ResponseEntity createFlash( + @Valid @RequestBody FlashV2CreateFlashBodyDto requestBody, + Principal principal + ) { + Integer userId = UserUtil.getUserId(principal); + return ResponseEntity.status(HttpStatus.CREATED).body(flashV2Service.createFlash(requestBody, userId)); + } + + @Override + @GetMapping("{meetingId}") + public ResponseEntity getFlashByMeetingId( + @PathVariable Integer meetingId, + Principal principal + ) { + Integer userId = UserUtil.getUserId(principal); + + return ResponseEntity.ok(flashV2Service.getFlashByMeetingId(meetingId, userId)); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/mapper/FlashMapper.java b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/mapper/FlashMapper.java new file mode 100644 index 00000000..b1755cd0 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/mapper/FlashMapper.java @@ -0,0 +1,59 @@ +package org.sopt.makers.crew.main.flash.v2.dto.mapper; + +import static org.sopt.makers.crew.main.global.constant.CrewConst.*; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.stream.IntStream; + +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.Named; +import org.sopt.makers.crew.main.entity.flash.Flash; +import org.sopt.makers.crew.main.entity.flash.enums.FlashPlaceType; +import org.sopt.makers.crew.main.entity.flash.enums.FlashTimingType; +import org.sopt.makers.crew.main.entity.meeting.vo.ImageUrlVO; +import org.sopt.makers.crew.main.global.util.Time; +import org.sopt.makers.crew.main.meeting.v2.dto.response.MeetingV2CreateMeetingForFlashResponseDto; + +@Mapper(componentModel = "spring") +public interface FlashMapper { + @Mapping(source = "meetingV2CreateMeetingForFlashResponseDto.files", target = "imageURL", qualifiedByName = "getImageURL") + @Mapping(target = "startDate", expression = "java(time.now())") + @Mapping(source = "meetingV2CreateMeetingForFlashResponseDto.activityStartDate", target = "endDate", qualifiedByName = "getActivityStartDate") + @Mapping(source = "meetingV2CreateMeetingForFlashResponseDto.activityStartDate", target = "activityStartDate", qualifiedByName = "getActivityStartDate") + @Mapping(source = "meetingV2CreateMeetingForFlashResponseDto.activityEndDate", target = "activityEndDate", qualifiedByName = "getActivityEndDate") + @Mapping(source = "meetingV2CreateMeetingForFlashResponseDto.flashPlaceType", target = "flashPlaceType", qualifiedByName = "getFlashPlaceType") + @Mapping(source = "meetingV2CreateMeetingForFlashResponseDto.flashTimingType", target = "flashTimingType", qualifiedByName = "getFlashTimingType") + Flash toFlashntity( + MeetingV2CreateMeetingForFlashResponseDto meetingV2CreateMeetingForFlashResponseDto, + Integer createdGeneration, Integer leaderUserId, Time time); + + @Named("getImageURL") + static List getImageURL(List files) { + return IntStream.range(0, files.size()) + .mapToObj(index -> new ImageUrlVO(index, files.get(index))) + .toList(); + } + + @Named("getActivityStartDate") + static LocalDateTime getActivityStartDate(String date) { + return LocalDateTime.parse(date + DAY_START_TIME, DateTimeFormatter.ofPattern(DAY_TIME_FORMAT)); + } + + @Named("getActivityEndDate") + static LocalDateTime getActivityEndDate(String date) { + return LocalDateTime.parse(date + DAY_END_TIME, DateTimeFormatter.ofPattern(DAY_TIME_FORMAT)); + } + + @Named("getFlashPlaceType") + static FlashPlaceType getFlashPlaceType(String placeType) { + return FlashPlaceType.ofValue(placeType); + } + + @Named("getFlashTimingType") + static FlashTimingType getFlashTimingType(String timingType) { + return FlashTimingType.ofValue(timingType); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/request/LightningV2CreateLightningBodyDto.java b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/request/FlashV2CreateFlashBodyDto.java similarity index 56% rename from main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/request/LightningV2CreateLightningBodyDto.java rename to main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/request/FlashV2CreateFlashBodyDto.java index 1ecfcaa3..d244eca2 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/request/LightningV2CreateLightningBodyDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/request/FlashV2CreateFlashBodyDto.java @@ -1,4 +1,4 @@ -package org.sopt.makers.crew.main.lightning.v2.dto.request; +package org.sopt.makers.crew.main.flash.v2.dto.request; import java.util.List; @@ -6,12 +6,12 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; -@Schema(name = "LightningV2CreateLightningBodyDto", description = "번쩍 모임 생성 및 수정 request body dto") -public record LightningV2CreateLightningBodyDto( +@Schema(name = "FlashV2CreateFlashBodyDto", description = "번쩍 모임 생성 및 수정 request body dto") +public record FlashV2CreateFlashBodyDto( @Schema(description = "번쩍 모임 생성 및 수정 request body") @NotNull @Valid - LightningV2CreateLightningBodyWithoutWelcomeMessageDto lightningBody, + FlashV2CreateFlashBodyWithoutWelcomeMessageDto flashBody, @Schema(example = "[\"YB 환영\", \"OB 환영\"]", description = "환영 메시지 타입 리스트") List welcomeMessageTypes diff --git a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/request/LightningV2CreateLightningBodyWithoutWelcomeMessageDto.java b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/request/FlashV2CreateFlashBodyWithoutWelcomeMessageDto.java similarity index 80% rename from main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/request/LightningV2CreateLightningBodyWithoutWelcomeMessageDto.java rename to main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/request/FlashV2CreateFlashBodyWithoutWelcomeMessageDto.java index 27249c6c..a9ac0aaa 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/request/LightningV2CreateLightningBodyWithoutWelcomeMessageDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/request/FlashV2CreateFlashBodyWithoutWelcomeMessageDto.java @@ -1,4 +1,4 @@ -package org.sopt.makers.crew.main.lightning.v2.dto.request; +package org.sopt.makers.crew.main.flash.v2.dto.request; import java.util.List; @@ -8,8 +8,8 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; -@Schema(name = "LightningV2CreateLightningBodyWithoutWelcomeMessageDto", description = "번쩍 모임 생성 및 수정 request body dto (환영 메시지 타입 제외)") -public record LightningV2CreateLightningBodyWithoutWelcomeMessageDto( +@Schema(name = "FlashV2CreateFlashBodyWithoutWelcomeMessageDto", description = "번쩍 모임 생성 및 수정 request body dto (환영 메시지 타입 제외)") +public record FlashV2CreateFlashBodyWithoutWelcomeMessageDto( @Schema(example = "알고보면 쓸데있는 개발 프로세스", description = "번쩍 모임 제목") @Size(min = 1, max = 30) @NotNull String title, @@ -21,7 +21,7 @@ public record LightningV2CreateLightningBodyWithoutWelcomeMessageDto( @Schema(example = "예정 기간(협의 후 결정)", description = "번쩍 일정 결정 방식") @NotNull - String lightningTimingType, + String flashTimingType, @Schema(example = "2025.10.29", description = "번쩍 활동 시작 날짜", name = "activityStartDate") @NotNull @@ -33,10 +33,10 @@ public record LightningV2CreateLightningBodyWithoutWelcomeMessageDto( @Schema(example = "오프라인", description = "모임 장소 Tag") @NotNull - String lightningPlaceType, + String flashPlaceType, @Schema(example = "잠실역 5번 출구", description = "모임 장소") - String lightningPlace, + String flashPlace, @Schema(example = "1", description = "최소 모집 인원") @Min(1) diff --git a/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/response/FlashV2CreateFlashResponseDto.java b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/response/FlashV2CreateFlashResponseDto.java new file mode 100644 index 00000000..d3e62f2b --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/response/FlashV2CreateFlashResponseDto.java @@ -0,0 +1,15 @@ +package org.sopt.makers.crew.main.flash.v2.dto.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +@Schema(name = "FlashV2CreateFlashResponseDto", description = "번쩍 모임 생성 응답 Dto") +public record FlashV2CreateFlashResponseDto( + @Schema(description = "모임 id - 번쩍 카테고리", example = "1") + @NotNull + Integer meetingId +) { + public static FlashV2CreateFlashResponseDto from(Integer meetingId) { + return new FlashV2CreateFlashResponseDto(meetingId); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/response/LightningV2GetLightningByMeetingIdResponseDto.java b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/response/FlashV2GetFlashByMeetingIdResponseDto.java similarity index 79% rename from main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/response/LightningV2GetLightningByMeetingIdResponseDto.java rename to main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/response/FlashV2GetFlashByMeetingIdResponseDto.java index 6c8f4ca4..264fb37e 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/response/LightningV2GetLightningByMeetingIdResponseDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/dto/response/FlashV2GetFlashByMeetingIdResponseDto.java @@ -1,9 +1,9 @@ -package org.sopt.makers.crew.main.lightning.v2.dto.response; +package org.sopt.makers.crew.main.flash.v2.dto.response; import java.time.LocalDateTime; import java.util.List; -import org.sopt.makers.crew.main.entity.lightning.Lightning; +import org.sopt.makers.crew.main.entity.flash.Flash; import org.sopt.makers.crew.main.entity.meeting.enums.MeetingCategory; import org.sopt.makers.crew.main.entity.meeting.vo.ImageUrlVO; import org.sopt.makers.crew.main.entity.tag.enums.WelcomeMessageType; @@ -16,8 +16,8 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; -@Schema(description = "번쩍 상세 조회 dto") -public record LightningV2GetLightningByMeetingIdResponseDto( +@Schema(name = "FlashV2GetFlashByMeetingIdResponseDto", description = "번쩍 상세 조회 dto") +public record FlashV2GetFlashByMeetingIdResponseDto( @Schema(description = "모임 id", example = "2") @NotNull @@ -117,9 +117,9 @@ public record LightningV2GetLightningByMeetingIdResponseDto( List appliedInfo ) { - public static LightningV2GetLightningByMeetingIdResponseDto of( + public static FlashV2GetFlashByMeetingIdResponseDto of( Integer meetingId, - Lightning lightning, + Flash flash, List welcomeMessageTypes, long approvedCount, boolean isHost, @@ -130,29 +130,29 @@ public static LightningV2GetLightningByMeetingIdResponseDto of( LocalDateTime now ) { - int lightningMeetingStatus = lightning.getLightningMeetingStatusValue(now); + int flashMeetingStatus = flash.getFlashMeetingStatusValue(now); List welcomeMessageTypeValues = welcomeMessageTypes.stream() .map(WelcomeMessageType::getValue) .toList(); - return new LightningV2GetLightningByMeetingIdResponseDto( + return new FlashV2GetFlashByMeetingIdResponseDto( meetingId, - lightning.getLeaderUserId(), - lightning.getTitle(), - MeetingCategory.LIGHTNING.getValue(), - lightning.getImageURL(), - lightning.getEndDate(), - lightning.getMinimumCapacity(), - lightning.getMaximumCapacity(), + flash.getLeaderUserId(), + flash.getTitle(), + MeetingCategory.FLASH.getValue(), + flash.getImageURL(), + flash.getEndDate(), + flash.getMinimumCapacity(), + flash.getMaximumCapacity(), welcomeMessageTypeValues, - lightning.getDesc(), - lightning.getActivityStartDate(), - lightning.getActivityEndDate(), - lightning.getLightningTimingType().getValue(), - lightning.getLightningPlaceType().getValue(), - lightning.getLightningPlace(), - lightning.getCreatedGeneration(), - lightningMeetingStatus, + flash.getDesc(), + flash.getActivityStartDate(), + flash.getActivityEndDate(), + flash.getFlashTimingType().getValue(), + flash.getFlashPlaceType().getValue(), + flash.getFlashPlace(), + flash.getCreatedGeneration(), + flashMeetingStatus, approvedCount, isHost, isApply, diff --git a/main/src/main/java/org/sopt/makers/crew/main/flash/v2/service/FlashV2Service.java b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/service/FlashV2Service.java new file mode 100644 index 00000000..72ff50bc --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/service/FlashV2Service.java @@ -0,0 +1,12 @@ +package org.sopt.makers.crew.main.flash.v2.service; + +import org.sopt.makers.crew.main.flash.v2.dto.request.FlashV2CreateFlashBodyDto; +import org.sopt.makers.crew.main.flash.v2.dto.response.FlashV2CreateFlashResponseDto; +import org.sopt.makers.crew.main.flash.v2.dto.response.FlashV2GetFlashByMeetingIdResponseDto; + +public interface FlashV2Service { + FlashV2CreateFlashResponseDto createFlash( + FlashV2CreateFlashBodyDto requestBody, Integer userId); + + FlashV2GetFlashByMeetingIdResponseDto getFlashByMeetingId(Integer meetingId, Integer userId); +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/service/LightningV2ServiceImpl.java b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/service/FlashV2ServiceImpl.java similarity index 60% rename from main/src/main/java/org/sopt/makers/crew/main/lightning/v2/service/LightningV2ServiceImpl.java rename to main/src/main/java/org/sopt/makers/crew/main/flash/v2/service/FlashV2ServiceImpl.java index c8ff375a..cc6885ea 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/service/LightningV2ServiceImpl.java +++ b/main/src/main/java/org/sopt/makers/crew/main/flash/v2/service/FlashV2ServiceImpl.java @@ -1,4 +1,4 @@ -package org.sopt.makers.crew.main.lightning.v2.service; +package org.sopt.makers.crew.main.flash.v2.service; import static org.sopt.makers.crew.main.entity.apply.enums.EnApplyStatus.*; import static org.sopt.makers.crew.main.global.constant.CrewConst.*; @@ -8,21 +8,21 @@ import org.sopt.makers.crew.main.entity.apply.Applies; import org.sopt.makers.crew.main.entity.apply.ApplyRepository; -import org.sopt.makers.crew.main.entity.lightning.Lightning; -import org.sopt.makers.crew.main.entity.lightning.LightningRepository; +import org.sopt.makers.crew.main.entity.flash.Flash; +import org.sopt.makers.crew.main.entity.flash.FlashRepository; import org.sopt.makers.crew.main.entity.tag.enums.WelcomeMessageType; import org.sopt.makers.crew.main.entity.user.User; import org.sopt.makers.crew.main.entity.user.UserReader; +import org.sopt.makers.crew.main.flash.v2.dto.mapper.FlashMapper; +import org.sopt.makers.crew.main.flash.v2.dto.request.FlashV2CreateFlashBodyDto; +import org.sopt.makers.crew.main.flash.v2.dto.response.FlashV2CreateFlashResponseDto; +import org.sopt.makers.crew.main.flash.v2.dto.response.FlashV2GetFlashByMeetingIdResponseDto; import org.sopt.makers.crew.main.global.dto.MeetingCreatorDto; import org.sopt.makers.crew.main.global.exception.BadRequestException; import org.sopt.makers.crew.main.global.exception.NotFoundException; import org.sopt.makers.crew.main.global.util.Time; -import org.sopt.makers.crew.main.lightning.v2.dto.mapper.LightningMapper; -import org.sopt.makers.crew.main.lightning.v2.dto.request.LightningV2CreateLightningBodyDto; -import org.sopt.makers.crew.main.lightning.v2.dto.response.LightningV2CreateLightningResponseDto; -import org.sopt.makers.crew.main.lightning.v2.dto.response.LightningV2GetLightningByMeetingIdResponseDto; import org.sopt.makers.crew.main.meeting.v2.dto.response.ApplyWholeInfoDto; -import org.sopt.makers.crew.main.meeting.v2.dto.response.MeetingV2CreateMeetingForLightningResponseDto; +import org.sopt.makers.crew.main.meeting.v2.dto.response.MeetingV2CreateMeetingForFlashResponseDto; import org.sopt.makers.crew.main.meeting.v2.service.MeetingV2Service; import org.sopt.makers.crew.main.tag.v2.service.TagV2Service; import org.sopt.makers.crew.main.user.v2.service.UserV2Service; @@ -34,7 +34,7 @@ @Service @RequiredArgsConstructor @Transactional(readOnly = true) -public class LightningV2ServiceImpl implements LightningV2Service { +public class FlashV2ServiceImpl implements FlashV2Service { private static final int INTRO_IMAGE_LIST_SIZE = 1; @@ -42,62 +42,62 @@ public class LightningV2ServiceImpl implements LightningV2Service { private final TagV2Service tagV2Service; private final MeetingV2Service meetingV2Service; - private final LightningRepository lightningRepository; + private final FlashRepository flashRepository; private final ApplyRepository applyRepository; private final UserReader userReader; - private final LightningMapper lightningMapper; + private final FlashMapper flashMapper; private final Time realTime; @Override @Transactional - public LightningV2CreateLightningResponseDto createLightning( - LightningV2CreateLightningBodyDto requestBody, Integer userId) { + public FlashV2CreateFlashResponseDto createFlash( + FlashV2CreateFlashBodyDto requestBody, Integer userId) { User user = userV2Service.getUserByUserId(userId); if (user.getActivities() == null) { throw new BadRequestException(VALIDATION_EXCEPTION.getErrorCode()); } - if (requestBody.lightningBody().files().size() > INTRO_IMAGE_LIST_SIZE) { + if (requestBody.flashBody().files().size() > INTRO_IMAGE_LIST_SIZE) { throw new BadRequestException(VALIDATION_EXCEPTION.getErrorCode()); } - MeetingV2CreateMeetingForLightningResponseDto meetingV2CreateMeetingForLightningResponseDto = meetingV2Service.createMeetingForLightning( - userId, requestBody.lightningBody()); + MeetingV2CreateMeetingForFlashResponseDto meetingV2CreateMeetingForFlashResponseDto = meetingV2Service.createMeetingForFlash( + userId, requestBody.flashBody()); - Lightning lightning = lightningMapper.toLightningEntity(meetingV2CreateMeetingForLightningResponseDto, + Flash flash = flashMapper.toFlashntity(meetingV2CreateMeetingForFlashResponseDto, ACTIVE_GENERATION, user.getId(), realTime); - lightningRepository.save(lightning); - tagV2Service.createLightningTag(requestBody.welcomeMessageTypes(), lightning.getId()); + flashRepository.save(flash); + tagV2Service.createFlashTag(requestBody.welcomeMessageTypes(), flash.getId()); - return LightningV2CreateLightningResponseDto.from(lightning.getMeetingId()); + return FlashV2CreateFlashResponseDto.from(flash.getMeetingId()); } - public LightningV2GetLightningByMeetingIdResponseDto getLightningByMeetingId(Integer meetingId, Integer userId) { + public FlashV2GetFlashByMeetingIdResponseDto getFlashByMeetingId(Integer meetingId, Integer userId) { User user = userV2Service.getUserByUserId(userId); - Lightning lightning = lightningRepository.findByMeetingId(meetingId) - .orElseThrow(() -> new NotFoundException(NOT_FOUND_LIGHTNING.getErrorCode())); + Flash flash = flashRepository.findByMeetingId(meetingId) + .orElseThrow(() -> new NotFoundException(NOT_FOUND_FLASH.getErrorCode())); - MeetingCreatorDto meetingLeader = userReader.getMeetingLeader(lightning.getLeaderUserId()); + MeetingCreatorDto meetingLeader = userReader.getMeetingLeader(flash.getLeaderUserId()); Applies applies = new Applies( applyRepository.findAllByMeetingIdWithUser(meetingId, List.of(WAITING, APPROVE, REJECT), ORDER_ASC)); - boolean isHost = lightning.checkLightningMeetingLeader(user.getId()); + boolean isHost = flash.checkFlashMeetingLeader(user.getId()); boolean isApply = applies.isApply(meetingId, user.getId()); boolean isApproved = applies.isApproved(meetingId, user.getId()); long approvedCount = applies.getApprovedCount(meetingId); List applyWholeInfoDtos = getApplyWholeInfoDtos(applies, meetingId, userId); - List welcomeMessageTypes = tagV2Service.getWelcomeMessageTypesByLightningId( - lightning.getId()); + List welcomeMessageTypes = tagV2Service.getWelcomeMessageTypesByFlashId( + flash.getId()); - return LightningV2GetLightningByMeetingIdResponseDto.of(meetingId, lightning, welcomeMessageTypes, + return FlashV2GetFlashByMeetingIdResponseDto.of(meetingId, flash, welcomeMessageTypes, approvedCount, isHost, isApply, isApproved, meetingLeader, applyWholeInfoDtos, realTime.now()); } diff --git a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/LightningV2Controller.java b/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/LightningV2Controller.java deleted file mode 100644 index 63c3cfaa..00000000 --- a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/LightningV2Controller.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.sopt.makers.crew.main.lightning.v2; - -import java.security.Principal; - -import org.sopt.makers.crew.main.global.util.UserUtil; -import org.sopt.makers.crew.main.lightning.v2.dto.request.LightningV2CreateLightningBodyDto; -import org.sopt.makers.crew.main.lightning.v2.dto.response.LightningV2CreateLightningResponseDto; -import org.sopt.makers.crew.main.lightning.v2.dto.response.LightningV2GetLightningByMeetingIdResponseDto; -import org.sopt.makers.crew.main.lightning.v2.service.LightningV2Service; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import jakarta.validation.Valid; -import lombok.RequiredArgsConstructor; - -@RestController -@RequestMapping("/lightning/v2") -@RequiredArgsConstructor -public class LightningV2Controller implements LightningV2Api { - private final LightningV2Service lightningV2Service; - - @Override - @PostMapping - public ResponseEntity createLightning( - @Valid @RequestBody LightningV2CreateLightningBodyDto requestBody, - Principal principal - ) { - Integer userId = UserUtil.getUserId(principal); - return ResponseEntity.status(HttpStatus.CREATED).body(lightningV2Service.createLightning(requestBody, userId)); - } - - @Override - @GetMapping("{meetingId}") - public ResponseEntity getLightningByMeetingId( - @PathVariable Integer meetingId, - Principal principal - ) { - Integer userId = UserUtil.getUserId(principal); - - return ResponseEntity.ok(lightningV2Service.getLightningByMeetingId(meetingId, userId)); - } -} diff --git a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/mapper/LightningMapper.java b/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/mapper/LightningMapper.java deleted file mode 100644 index ba4b6adb..00000000 --- a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/mapper/LightningMapper.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.sopt.makers.crew.main.lightning.v2.dto.mapper; - -import static org.sopt.makers.crew.main.global.constant.CrewConst.*; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.stream.IntStream; - -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; -import org.mapstruct.Named; -import org.sopt.makers.crew.main.entity.lightning.Lightning; -import org.sopt.makers.crew.main.entity.lightning.enums.LightningPlaceType; -import org.sopt.makers.crew.main.entity.lightning.enums.LightningTimingType; -import org.sopt.makers.crew.main.entity.meeting.vo.ImageUrlVO; -import org.sopt.makers.crew.main.global.util.Time; -import org.sopt.makers.crew.main.meeting.v2.dto.response.MeetingV2CreateMeetingForLightningResponseDto; - -@Mapper(componentModel = "spring") -public interface LightningMapper { - @Mapping(source = "meetingV2CreateMeetingForLightningResponseDto.files", target = "imageURL", qualifiedByName = "getImageURL") - @Mapping(target = "startDate", expression = "java(time.now())") - @Mapping(source = "meetingV2CreateMeetingForLightningResponseDto.activityStartDate", target = "endDate", qualifiedByName = "getActivityStartDate") - @Mapping(source = "meetingV2CreateMeetingForLightningResponseDto.activityStartDate", target = "activityStartDate", qualifiedByName = "getActivityStartDate") - @Mapping(source = "meetingV2CreateMeetingForLightningResponseDto.activityEndDate", target = "activityEndDate", qualifiedByName = "getActivityEndDate") - @Mapping(source = "meetingV2CreateMeetingForLightningResponseDto.lightningPlaceType", target = "lightningPlaceType", qualifiedByName = "getLightningPlaceType") - @Mapping(source = "meetingV2CreateMeetingForLightningResponseDto.lightningTimingType", target = "lightningTimingType", qualifiedByName = "getLightningTimingType") - Lightning toLightningEntity( - MeetingV2CreateMeetingForLightningResponseDto meetingV2CreateMeetingForLightningResponseDto, - Integer createdGeneration, Integer leaderUserId, Time time); - - @Named("getImageURL") - static List getImageURL(List files) { - return IntStream.range(0, files.size()) - .mapToObj(index -> new ImageUrlVO(index, files.get(index))) - .toList(); - } - - @Named("getActivityStartDate") - static LocalDateTime getActivityStartDate(String date) { - return LocalDateTime.parse(date + DAY_START_TIME, DateTimeFormatter.ofPattern(DAY_TIME_FORMAT)); - } - - @Named("getActivityEndDate") - static LocalDateTime getActivityEndDate(String date) { - return LocalDateTime.parse(date + DAY_END_TIME, DateTimeFormatter.ofPattern(DAY_TIME_FORMAT)); - } - - @Named("getLightningPlaceType") - static LightningPlaceType getLightningPlaceType(String placeType) { - return LightningPlaceType.ofValue(placeType); - } - - @Named("getLightningTimingType") - static LightningTimingType getLightningTimingType(String timingType) { - return LightningTimingType.ofValue(timingType); - } -} diff --git a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/response/LightningV2CreateLightningResponseDto.java b/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/response/LightningV2CreateLightningResponseDto.java deleted file mode 100644 index 9289dbbd..00000000 --- a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/dto/response/LightningV2CreateLightningResponseDto.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.sopt.makers.crew.main.lightning.v2.dto.response; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; - -@Schema(name = "LightningV2CreateLightningResponseDto", description = "번쩍 모임 생성 응답 Dto") -public record LightningV2CreateLightningResponseDto( - @Schema(description = "모임 id - 번쩍 카테고리", example = "1") - @NotNull - Integer meetingId -) { - public static LightningV2CreateLightningResponseDto from(Integer meetingId) { - return new LightningV2CreateLightningResponseDto(meetingId); - } -} diff --git a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/service/LightningV2Service.java b/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/service/LightningV2Service.java deleted file mode 100644 index 014d3254..00000000 --- a/main/src/main/java/org/sopt/makers/crew/main/lightning/v2/service/LightningV2Service.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.sopt.makers.crew.main.lightning.v2.service; - -import org.sopt.makers.crew.main.lightning.v2.dto.request.LightningV2CreateLightningBodyDto; -import org.sopt.makers.crew.main.lightning.v2.dto.response.LightningV2CreateLightningResponseDto; -import org.sopt.makers.crew.main.lightning.v2.dto.response.LightningV2GetLightningByMeetingIdResponseDto; - -public interface LightningV2Service { - LightningV2CreateLightningResponseDto createLightning( - LightningV2CreateLightningBodyDto requestBody, Integer userId); - - LightningV2GetLightningByMeetingIdResponseDto getLightningByMeetingId(Integer meetingId, Integer userId); -}