From c76fa4afea8754f2878cb38ed198bd61ba58cc2c Mon Sep 17 00:00:00 2001 From: JunsuPark Date: Thu, 15 Aug 2024 20:40:03 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EA=B3=B5=EC=97=B0=20=ED=8B=B0?= =?UTF-8?q?=EC=BC=93=ED=8C=85=20=EC=95=8C=EB=A6=BC=20=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EB=B0=8F=20=EC=A1=B0=ED=9A=8C=20(#107)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/example/config/SecurityConfig.java | 3 +- .../com/example/publish/MessagePublisher.java | 4 +- .../message/ReserveShowServiceMessage.java | 14 --- ...icketingAlertsToReserveServiceMessage.java | 27 +++++ .../TicketingReservationServiceMessage.java | 10 -- .../show/controller/ShowController.java | 28 ++++- .../ShowAlertRegistrationApiRequest.java | 13 --- .../TicketingAlertReservationApiRequest.java | 29 +++++ .../TicketingAlertReservationApiResponse.java | 31 +++++ ...ertReservationAvailabilityApiResponse.java | 28 +++++ ...tingAlertReservationStatusApiResponse.java | 29 +++++ .../controller/vo/ShowAlertTimeApiType.java | 7 -- .../vo/TicketingAlertTimeApiType.java | 47 ++++++++ .../com/example/show/service/ShowService.java | 64 ++++++++++- ...cketingAlertReservationServiceRequest.java | 33 ++++++ ...eservationAvailabilityServiceResponse.java | 28 +++++ ...ketingAlertReservationServiceResponse.java | 21 ++++ ...AlertReservationStatusServiceResponse.java | 43 +++++++ .../java/show/service/ShowServiceTest.java | 11 +- .../show/ShowTicketingTimeRepository.java | 19 ++++ .../org/example/usecase/show/ShowUseCase.java | 18 +++ .../org/example/config/UserDomainConfig.java | 2 + ...icketingAlertReservationDomainRequest.java | 21 ++++ .../TicketingAlertsDomainResponse.java | 17 +++ .../org/example/entity/TicketingAlert.java | 14 +++ .../TicketingAlertQuerydslRepository.java | 5 + .../TicketingAlertQuerydslRepositoryImpl.java | 13 +++ .../ticketing/TicketingAlertRepository.java | 13 +++ .../usecase/TicketingAlertUseCase.java | 107 ++++++++++++++++++ .../org/example/vo/TicketingAlertTime.java | 7 ++ .../java/org/example/vo/TicketingType.java | 8 ++ .../message/ReserveShowInfraMessage.java | 25 ---- .../TicketingReservationInfraMessage.java | 18 +-- .../publish/RedisMessagePublisher.java | 4 +- 34 files changed, 673 insertions(+), 88 deletions(-) delete mode 100644 app/api/show-api/src/main/java/com/example/publish/message/ReserveShowServiceMessage.java create mode 100644 app/api/show-api/src/main/java/com/example/publish/message/TicketingAlertsToReserveServiceMessage.java delete mode 100644 app/api/show-api/src/main/java/com/example/publish/message/TicketingReservationServiceMessage.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/request/ShowAlertRegistrationApiRequest.java create mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/request/TicketingAlertReservationApiRequest.java create mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationApiResponse.java create mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationAvailabilityApiResponse.java create mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationStatusApiResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/controller/vo/ShowAlertTimeApiType.java create mode 100644 app/api/show-api/src/main/java/com/example/show/controller/vo/TicketingAlertTimeApiType.java create mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/request/TicketingAlertReservationServiceRequest.java create mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationAvailabilityServiceResponse.java create mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationServiceResponse.java create mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationStatusServiceResponse.java create mode 100644 app/domain/user-domain/src/main/java/org/example/dto/request/TicketingAlertReservationDomainRequest.java create mode 100644 app/domain/user-domain/src/main/java/org/example/dto/response/TicketingAlertsDomainResponse.java create mode 100644 app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertQuerydslRepository.java create mode 100644 app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertQuerydslRepositoryImpl.java create mode 100644 app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertRepository.java create mode 100644 app/domain/user-domain/src/main/java/org/example/usecase/TicketingAlertUseCase.java create mode 100644 app/domain/user-domain/src/main/java/org/example/vo/TicketingAlertTime.java create mode 100644 app/domain/user-domain/src/main/java/org/example/vo/TicketingType.java delete mode 100644 app/infrastructure/message-queue/src/main/java/org/example/message/ReserveShowInfraMessage.java diff --git a/app/api/common-api/src/main/java/org/example/config/SecurityConfig.java b/app/api/common-api/src/main/java/org/example/config/SecurityConfig.java index 16171653..1d31be89 100644 --- a/app/api/common-api/src/main/java/org/example/config/SecurityConfig.java +++ b/app/api/common-api/src/main/java/org/example/config/SecurityConfig.java @@ -93,7 +93,8 @@ private RequestMatcher getMatcherForUserAndAdmin() { antMatcher(HttpMethod.POST, "/api/v1/users/withdrawal"), antMatcher(HttpMethod.GET, "/api/v1/users/profile"), antMatcher(HttpMethod.POST, "/api/v1/shows/**/interest"), - antMatcher(HttpMethod.POST, "/api/v1/shows/**/alert"), + antMatcher(HttpMethod.POST, "/api/v1/shows/{showId}/alert"), + antMatcher(HttpMethod.GET, "/api/v1/shows/{showId}/alert/reservations"), antMatcher(HttpMethod.POST, "/api/v1/genres/subscribe"), antMatcher(HttpMethod.POST, "/api/v1/genres/unsubscribe"), antMatcher(HttpMethod.GET, "/api/v1/genres/subscriptions"), diff --git a/app/api/show-api/src/main/java/com/example/publish/MessagePublisher.java b/app/api/show-api/src/main/java/com/example/publish/MessagePublisher.java index f1b250a6..3b985736 100644 --- a/app/api/show-api/src/main/java/com/example/publish/MessagePublisher.java +++ b/app/api/show-api/src/main/java/com/example/publish/MessagePublisher.java @@ -3,7 +3,7 @@ import com.example.publish.message.ArtistSubscriptionServiceMessage; import com.example.publish.message.GenreSubscriptionServiceMessage; import com.example.publish.message.ShowRelationArtistAndGenreServiceMessage; -import com.example.publish.message.TicketingReservationServiceMessage; +import com.example.publish.message.TicketingAlertsToReserveServiceMessage; public interface MessagePublisher { @@ -13,5 +13,5 @@ public interface MessagePublisher { void publishGenreSubscription(String topic, GenreSubscriptionServiceMessage message); - void publishTicketingReservation(String topic, TicketingReservationServiceMessage message); + void publishTicketingReservation(String topic, TicketingAlertsToReserveServiceMessage message); } diff --git a/app/api/show-api/src/main/java/com/example/publish/message/ReserveShowServiceMessage.java b/app/api/show-api/src/main/java/com/example/publish/message/ReserveShowServiceMessage.java deleted file mode 100644 index 95ca8d53..00000000 --- a/app/api/show-api/src/main/java/com/example/publish/message/ReserveShowServiceMessage.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.example.publish.message; - -import com.example.show.controller.vo.TicketingApiType; -import java.time.LocalDateTime; -import java.util.UUID; - -public record ReserveShowServiceMessage( - LocalDateTime reserveAt, - String showName, - TicketingApiType type, - UUID showId -) { - -} diff --git a/app/api/show-api/src/main/java/com/example/publish/message/TicketingAlertsToReserveServiceMessage.java b/app/api/show-api/src/main/java/com/example/publish/message/TicketingAlertsToReserveServiceMessage.java new file mode 100644 index 00000000..2e40c111 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/publish/message/TicketingAlertsToReserveServiceMessage.java @@ -0,0 +1,27 @@ +package com.example.publish.message; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.UUID; +import lombok.Builder; +import org.example.dto.response.TicketingAlertsDomainResponse; + +@Builder +public record TicketingAlertsToReserveServiceMessage( + String userFcmToken, + String name, + UUID showId, + List reserveAts +) { + + public static TicketingAlertsToReserveServiceMessage from( + TicketingAlertsDomainResponse responses + ) { + return TicketingAlertsToReserveServiceMessage.builder() + .userFcmToken(responses.userFcmToken()) + .name(responses.name()) + .showId(responses.showId()) + .reserveAts(responses.reservedAts()) + .build(); + } +} diff --git a/app/api/show-api/src/main/java/com/example/publish/message/TicketingReservationServiceMessage.java b/app/api/show-api/src/main/java/com/example/publish/message/TicketingReservationServiceMessage.java deleted file mode 100644 index 143d5a1a..00000000 --- a/app/api/show-api/src/main/java/com/example/publish/message/TicketingReservationServiceMessage.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.example.publish.message; - -import java.util.List; - -public record TicketingReservationServiceMessage( - String userFcmToken, - List reserveShows -) { - -} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/ShowController.java b/app/api/show-api/src/main/java/com/example/show/controller/ShowController.java index 4cddc925..a2480f5c 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/ShowController.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/ShowController.java @@ -1,15 +1,17 @@ package com.example.show.controller; import com.example.show.controller.dto.param.ShowSearchPaginationApiParam; -import com.example.show.controller.dto.request.ShowAlertRegistrationApiRequest; import com.example.show.controller.dto.request.ShowInterestPaginationApiRequest; import com.example.show.controller.dto.request.ShowPaginationApiRequest; import com.example.show.controller.dto.request.ShowSearchPaginationApiRequest; +import com.example.show.controller.dto.request.TicketingAlertReservationApiRequest; import com.example.show.controller.dto.response.InterestShowPaginationApiResponse; import com.example.show.controller.dto.response.ShowAlertPaginationApiResponse; import com.example.show.controller.dto.response.ShowDetailApiResponse; import com.example.show.controller.dto.response.ShowInterestApiResponse; import com.example.show.controller.dto.response.ShowPaginationApiParam; +import com.example.show.controller.dto.response.TicketingAlertReservationApiResponse; +import com.example.show.controller.vo.TicketingApiType; import com.example.show.service.ShowService; import com.example.show.service.dto.request.ShowInterestServiceRequest; import com.example.show.service.dto.response.ShowPaginationServiceResponse; @@ -117,15 +119,35 @@ public ResponseEntity getShow( ); } + @GetMapping("/{showId}/alert/reservations") + @Operation(summary = "공연 티켓팅 알림 예약 조회") + public ResponseEntity getAlertsReservations( + @AuthenticationPrincipal AuthenticatedUser user, + @PathVariable("showId") UUID showId, + @RequestParam("ticketingApiType") TicketingApiType type + ) { + return ResponseEntity.ok( + TicketingAlertReservationApiResponse.from( + showService.findAlertsReservations(user.userId(), showId, type) + ) + ); + } + @PostMapping("/{showId}/alert") @Operation( - summary = "공연 알림 등록 / 취소", + summary = "공연 티켓팅 알림 등록 / 취소", description = "요청한 알람 시간으로 기존 내용을 덮어쓴다." ) public ResponseEntity alert( + @AuthenticationPrincipal AuthenticatedUser user, @PathVariable("showId") UUID showId, - @Valid @RequestBody ShowAlertRegistrationApiRequest request + @RequestParam("ticketingApiType") TicketingApiType type, + @Valid @RequestBody TicketingAlertReservationApiRequest ticketingAlertReservationRequest ) { + showService.alertReservation( + ticketingAlertReservationRequest.toServiceRequest(user.userId(), showId, type) + ); + return ResponseEntity.noContent().build(); } diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/request/ShowAlertRegistrationApiRequest.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/request/ShowAlertRegistrationApiRequest.java deleted file mode 100644 index 1a66fbbd..00000000 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/request/ShowAlertRegistrationApiRequest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.show.controller.dto.request; - -import com.example.show.controller.vo.ShowAlertTimeApiType; -import io.swagger.v3.oas.annotations.media.Schema; -import java.util.List; - -public record ShowAlertRegistrationApiRequest( - - @Schema(description = "공연 티켓팅 알림 시간 선택") - List alertTimes -) { - -} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/request/TicketingAlertReservationApiRequest.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/request/TicketingAlertReservationApiRequest.java new file mode 100644 index 00000000..7ea85530 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/request/TicketingAlertReservationApiRequest.java @@ -0,0 +1,29 @@ +package com.example.show.controller.dto.request; + +import com.example.show.controller.vo.TicketingAlertTimeApiType; +import com.example.show.controller.vo.TicketingApiType; +import com.example.show.service.dto.request.TicketingAlertReservationServiceRequest; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import java.util.UUID; +import org.example.util.ValidateStatus; + +public record TicketingAlertReservationApiRequest( + + @Schema(description = "공연 티켓팅 알림 시간 선택") + List alertTimes +) { + + public TicketingAlertReservationServiceRequest toServiceRequest( + UUID userId, + UUID showId, + TicketingApiType type + ) { + return TicketingAlertReservationServiceRequest.builder() + .userId(userId) + .showId(showId) + .type(type) + .alertTimes(ValidateStatus.checkNullOrEmpty(alertTimes)) + .build(); + } +} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationApiResponse.java new file mode 100644 index 00000000..caf29424 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationApiResponse.java @@ -0,0 +1,31 @@ +package com.example.show.controller.dto.response; + +import com.example.show.service.dto.response.TicketingAlertReservationServiceResponse; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; + +@Builder +public record TicketingAlertReservationApiResponse( + @Schema(description = "공연 알림 예약 상태") + TicketingAlertReservationStatusApiResponse alertReservationStatus, + + @Schema(description = "공연 알림 예약 가능 여부") + TicketingAlertReservationAvailabilityApiResponse alertReservationAvailability +) { + public static TicketingAlertReservationApiResponse from( + TicketingAlertReservationServiceResponse response + ) { + var alertReservationStatus = TicketingAlertReservationStatusApiResponse.from( + response.alertReservationStatus() + ); + var alertReservationAvailability = TicketingAlertReservationAvailabilityApiResponse.from( + response.alertReservationAvailability() + ); + + return TicketingAlertReservationApiResponse.builder() + .alertReservationStatus(alertReservationStatus) + .alertReservationAvailability(alertReservationAvailability) + .build(); + } + +} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationAvailabilityApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationAvailabilityApiResponse.java new file mode 100644 index 00000000..41b32c8b --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationAvailabilityApiResponse.java @@ -0,0 +1,28 @@ +package com.example.show.controller.dto.response; + +import com.example.show.service.dto.response.TicketingAlertReservationAvailabilityServiceResponse; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; + +@Builder +public record TicketingAlertReservationAvailabilityApiResponse( + @Schema(description = "공연 티켓팅 24 시간 전") + boolean canReserve24, + + @Schema(description = "공연 티켓팅 6 시간 전") + boolean canReserve6, + + @Schema(description = "공연 티켓팅 1 시간 전") + boolean canReserve1 +) { + + public static TicketingAlertReservationAvailabilityApiResponse from( + TicketingAlertReservationAvailabilityServiceResponse response + ) { + return TicketingAlertReservationAvailabilityApiResponse.builder() + .canReserve24(response.canReserve24()) + .canReserve6(response.canReserve6()) + .canReserve1(response.canReserve1()) + .build(); + } +} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationStatusApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationStatusApiResponse.java new file mode 100644 index 00000000..e6d2d03b --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationStatusApiResponse.java @@ -0,0 +1,29 @@ +package com.example.show.controller.dto.response; + +import com.example.show.service.dto.response.TicketingAlertReservationStatusServiceResponse; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; + +@Builder +public record TicketingAlertReservationStatusApiResponse( + + @Schema(description = "공연 티켓팅 24 시간 전") + boolean before24, + + @Schema(description = "공연 티켓팅 6 시간 전") + boolean before6, + + @Schema(description = "공연 티켓팅 1 시간 전") + boolean before1 +) { + + public static TicketingAlertReservationStatusApiResponse from( + TicketingAlertReservationStatusServiceResponse response + ) { + return TicketingAlertReservationStatusApiResponse.builder() + .before24(response.before24()) + .before6(response.before6()) + .before1(response.before1()) + .build(); + } +} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/vo/ShowAlertTimeApiType.java b/app/api/show-api/src/main/java/com/example/show/controller/vo/ShowAlertTimeApiType.java deleted file mode 100644 index e185bc58..00000000 --- a/app/api/show-api/src/main/java/com/example/show/controller/vo/ShowAlertTimeApiType.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example.show.controller.vo; - -public enum ShowAlertTimeApiType { - BEFORE_A_DAY, - BEFORE_A_HOUR, - TEN_AM_ON_TICKETING_DAY; -} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/vo/TicketingAlertTimeApiType.java b/app/api/show-api/src/main/java/com/example/show/controller/vo/TicketingAlertTimeApiType.java new file mode 100644 index 00000000..82c4bf0b --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/controller/vo/TicketingAlertTimeApiType.java @@ -0,0 +1,47 @@ +package com.example.show.controller.vo; + +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.List; +import org.example.vo.TicketingAlertTime; + +public enum TicketingAlertTimeApiType { + BEFORE_24(24), + BEFORE_6(6), + BEFORE_1(1); + + private final int time; + + TicketingAlertTimeApiType(int time) { + this.time = time; + } + + public TicketingAlertTime toDomainType() { + return switch (this) { + case BEFORE_24 -> TicketingAlertTime.BEFORE_24; + case BEFORE_6 -> TicketingAlertTime.BEFORE_6; + case BEFORE_1 -> TicketingAlertTime.BEFORE_1; + }; + } + + public static List availableReserveTimeToDomainType(LocalDateTime ticketingAt) { + long hoursDifference = Duration.between(LocalDateTime.now(), ticketingAt).toHours(); + + return ALL_ALERT_TIMES.stream() + .filter(alertTime -> { + return switch (alertTime) { + case BEFORE_24 -> hoursDifference >= 24; + case BEFORE_6 -> hoursDifference >= 6; + case BEFORE_1 -> hoursDifference >= 1; + }; + }) + .toList(); + } + + private static final List ALL_ALERT_TIMES = List.of( + TicketingAlertTime.BEFORE_24, + TicketingAlertTime.BEFORE_6, + TicketingAlertTime.BEFORE_1 + ); + +} diff --git a/app/api/show-api/src/main/java/com/example/show/service/ShowService.java b/app/api/show-api/src/main/java/com/example/show/service/ShowService.java index aebe00ce..e1a97b3d 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/ShowService.java +++ b/app/api/show-api/src/main/java/com/example/show/service/ShowService.java @@ -1,15 +1,22 @@ package com.example.show.service; +import com.example.publish.MessagePublisher; +import com.example.publish.message.TicketingAlertsToReserveServiceMessage; +import com.example.show.controller.vo.TicketingApiType; import com.example.show.error.ShowError; import com.example.show.service.dto.param.ShowSearchPaginationServiceParam; import com.example.show.service.dto.request.InterestShowPaginationServiceRequest; import com.example.show.service.dto.request.ShowInterestServiceRequest; import com.example.show.service.dto.request.ShowPaginationServiceRequest; import com.example.show.service.dto.request.ShowSearchPaginationServiceRequest; +import com.example.show.service.dto.request.TicketingAlertReservationServiceRequest; import com.example.show.service.dto.response.InterestShowPaginationServiceResponse; import com.example.show.service.dto.response.ShowDetailServiceResponse; import com.example.show.service.dto.response.ShowInterestServiceResponse; import com.example.show.service.dto.response.ShowPaginationServiceResponse; +import com.example.show.service.dto.response.TicketingAlertReservationAvailabilityServiceResponse; +import com.example.show.service.dto.response.TicketingAlertReservationServiceResponse; +import com.example.show.service.dto.response.TicketingAlertReservationStatusServiceResponse; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; @@ -19,8 +26,11 @@ import org.example.dto.response.PaginationServiceResponse; import org.example.dto.show.response.ShowDetailDomainResponse; import org.example.entity.InterestShow; +import org.example.entity.TicketingAlert; import org.example.entity.show.Show; +import org.example.entity.show.ShowTicketingTime; import org.example.exception.BusinessException; +import org.example.usecase.TicketingAlertUseCase; import org.example.usecase.UserShowUseCase; import org.example.usecase.show.ShowUseCase; import org.springframework.stereotype.Service; @@ -30,7 +40,10 @@ public class ShowService { private final ShowUseCase showUseCase; + private final TicketingAlertUseCase ticketingAlertUseCase; private final UserShowUseCase userShowUseCase; + private final MessagePublisher messagePublisher; + public ShowDetailServiceResponse getShow(UUID id) { ShowDetailDomainResponse showDetail; @@ -55,10 +68,13 @@ public PaginationServiceResponse searchShow( return PaginationServiceResponse.of(data, response.hasNext()); } - public PaginationServiceResponse findShows(ShowPaginationServiceRequest request) { + public PaginationServiceResponse findShows( + ShowPaginationServiceRequest request + ) { var response = showUseCase.findShows(request.toDomainRequest()); var data = response.data().stream() - .map(domainResponse -> ShowPaginationServiceResponse.from(domainResponse, request.now())) + .map( + domainResponse -> ShowPaginationServiceResponse.from(domainResponse, request.now())) .toList(); return PaginationServiceResponse.of( @@ -95,4 +111,48 @@ public ShowInterestServiceResponse interest(ShowInterestServiceRequest request) userShowUseCase.interest(request.toDomainRequest()) ); } + + public TicketingAlertReservationServiceResponse findAlertsReservations( + UUID userId, + UUID showId, + TicketingApiType type + ) { + var ticketingAt = showUseCase + .findTicketingAlertReservation(showId, type.toDomainType()) + .getTicketingAt(); + + var reservedAlerts = ticketingAlertUseCase.findTicketingAlerts(userId, showId) + .stream() + .map(TicketingAlert::getAlertTime) + .toList(); + + var status = TicketingAlertReservationStatusServiceResponse.as( + reservedAlerts, + ticketingAt + ); + var availability = TicketingAlertReservationAvailabilityServiceResponse.as(ticketingAt); + + return TicketingAlertReservationServiceResponse.as(status, availability); + } + + public void alertReservation( + TicketingAlertReservationServiceRequest ticketingAlertReservationRequest + ) { + ShowTicketingTime showTicketingTime = showUseCase.findTicketingTimeWithShow( + ticketingAlertReservationRequest.showId(), + ticketingAlertReservationRequest.type().toDomainType() + ); + + var domainResponse = ticketingAlertUseCase.alertReservation( + ticketingAlertReservationRequest.toDomainRequest( + showTicketingTime.getShow().getTitle(), + showTicketingTime.getTicketingAt() + ) + ); + + messagePublisher.publishTicketingReservation( + "ticketingAlert", + TicketingAlertsToReserveServiceMessage.from(domainResponse) + ); + } } diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/request/TicketingAlertReservationServiceRequest.java b/app/api/show-api/src/main/java/com/example/show/service/dto/request/TicketingAlertReservationServiceRequest.java new file mode 100644 index 00000000..943b97d8 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/request/TicketingAlertReservationServiceRequest.java @@ -0,0 +1,33 @@ +package com.example.show.service.dto.request; + +import com.example.show.controller.vo.TicketingAlertTimeApiType; +import com.example.show.controller.vo.TicketingApiType; +import java.time.LocalDateTime; +import java.util.List; +import java.util.UUID; +import lombok.Builder; +import org.example.dto.request.TicketingAlertReservationDomainRequest; + +@Builder +public record TicketingAlertReservationServiceRequest( + + UUID userId, + UUID showId, + TicketingApiType type, + List alertTimes +) { + + public TicketingAlertReservationDomainRequest toDomainRequest( + String name, + LocalDateTime ticketingAt + ) { + return TicketingAlertReservationDomainRequest.builder() + .userId(userId) + .showId(showId) + .type(type.toDomainType()) + .name(name) + .ticketingAt(ticketingAt) + .alertTimes(TicketingAlertTimeApiType.availableReserveTimeToDomainType(ticketingAt)) + .build(); + } +} diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationAvailabilityServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationAvailabilityServiceResponse.java new file mode 100644 index 00000000..15689d80 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationAvailabilityServiceResponse.java @@ -0,0 +1,28 @@ +package com.example.show.service.dto.response; + +import java.time.Duration; +import java.time.LocalDateTime; +import lombok.Builder; + +@Builder +public record TicketingAlertReservationAvailabilityServiceResponse( + boolean canReserve24, + boolean canReserve6, + boolean canReserve1 +) { + + public static TicketingAlertReservationAvailabilityServiceResponse as(LocalDateTime ticketingAt) { + LocalDateTime now = LocalDateTime.now(); + long hoursDifference = Duration.between(now, ticketingAt).toHours(); + + boolean canReserve24 = hoursDifference >= 24; + boolean canReserve6 = hoursDifference >= 6; + boolean canReserve1 = hoursDifference >= 1; + + return TicketingAlertReservationAvailabilityServiceResponse.builder() + .canReserve24(canReserve24) + .canReserve6(canReserve6) + .canReserve1(canReserve1) + .build(); + } +} diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationServiceResponse.java new file mode 100644 index 00000000..86733b46 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationServiceResponse.java @@ -0,0 +1,21 @@ +package com.example.show.service.dto.response; + +import lombok.Builder; + +@Builder +public record TicketingAlertReservationServiceResponse( + TicketingAlertReservationStatusServiceResponse alertReservationStatus, + TicketingAlertReservationAvailabilityServiceResponse alertReservationAvailability +) { + + public static TicketingAlertReservationServiceResponse as( + TicketingAlertReservationStatusServiceResponse alertReservationStatus, + TicketingAlertReservationAvailabilityServiceResponse alertReservationAvailability + ) { + return TicketingAlertReservationServiceResponse.builder() + .alertReservationStatus(alertReservationStatus) + .alertReservationAvailability(alertReservationAvailability) + .build(); + } + +} diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationStatusServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationStatusServiceResponse.java new file mode 100644 index 00000000..04c9151c --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationStatusServiceResponse.java @@ -0,0 +1,43 @@ +package com.example.show.service.dto.response; + +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.List; +import lombok.Builder; + +@Builder +public record TicketingAlertReservationStatusServiceResponse( + boolean before24, + boolean before6, + boolean before1 +) { + + public static TicketingAlertReservationStatusServiceResponse as( + List reservedAlerts, + LocalDateTime ticketingAt + ) { + boolean before24 = false; + boolean before6 = false; + boolean before1 = false; + + for (LocalDateTime alertTime : reservedAlerts) { + long hoursDifference = Duration.between(alertTime, ticketingAt).toHours(); + + switch ((int) hoursDifference) { + case 24 -> before24 = true; + case 6 -> before6 = true; + case 1 -> before1 = true; + default -> { + + } + } + } + + return TicketingAlertReservationStatusServiceResponse.builder() + .before24(before24) + .before6(before6) + .before1(before1) + .build(); + } + +} diff --git a/app/api/show-api/src/test/java/show/service/ShowServiceTest.java b/app/api/show-api/src/test/java/show/service/ShowServiceTest.java index 2e4c2120..5f6ab4eb 100644 --- a/app/api/show-api/src/test/java/show/service/ShowServiceTest.java +++ b/app/api/show-api/src/test/java/show/service/ShowServiceTest.java @@ -3,8 +3,10 @@ import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; +import com.example.publish.MessagePublisher; import com.example.show.service.ShowService; import org.assertj.core.api.SoftAssertions; +import org.example.usecase.TicketingAlertUseCase; import org.example.usecase.UserShowUseCase; import org.example.usecase.show.ShowUseCase; import org.junit.jupiter.api.DisplayName; @@ -16,7 +18,14 @@ class ShowServiceTest { private final ShowUseCase showUseCase = mock(ShowUseCase.class); private final UserShowUseCase userShowUseCase = mock(UserShowUseCase.class); - private final ShowService showService = new ShowService(showUseCase, userShowUseCase); + private final TicketingAlertUseCase ticketingAlertUseCase = mock(TicketingAlertUseCase.class); + private final MessagePublisher messagePublisher = mock(MessagePublisher.class); + private final ShowService showService = new ShowService( + showUseCase, + ticketingAlertUseCase, + userShowUseCase, + messagePublisher + ); @Test @DisplayName("페이지네이션을 이용해 공연을 검색 할 수 있다.") diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/ShowTicketingTimeRepository.java b/app/domain/show-domain/src/main/java/org/example/repository/show/ShowTicketingTimeRepository.java index 603889f8..2e78ebe1 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/ShowTicketingTimeRepository.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/ShowTicketingTimeRepository.java @@ -1,11 +1,30 @@ package org.example.repository.show; import java.util.List; +import java.util.Optional; import java.util.UUID; import org.example.entity.show.ShowTicketingTime; +import org.example.vo.TicketingType; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; public interface ShowTicketingTimeRepository extends JpaRepository { List findAllByShowIdAndIsDeletedFalse(UUID showId); + + Optional findByShowIdAndTicketingTypeAndIsDeletedFalse( + UUID showId, + TicketingType type + ); + + @Query( + "SELECT stt FROM ShowTicketingTime stt JOIN FETCH stt.show " + + "WHERE stt.show.id = :showId AND stt.ticketingType = :type " + + "AND stt.isDeleted = false" + ) + Optional findByShowIdAndTicketingTypeWithShow( + @Param("showId") UUID showId, + @Param("type") TicketingType type + ); } diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/show/ShowUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/show/ShowUseCase.java index d8269b80..761f9e77 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/show/ShowUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/show/ShowUseCase.java @@ -18,12 +18,14 @@ import org.example.entity.show.ShowArtist; import org.example.entity.show.ShowGenre; import org.example.entity.show.ShowSearch; +import org.example.entity.show.ShowTicketingTime; import org.example.entity.show.info.ShowTicketingTimes; import org.example.repository.show.ShowRepository; import org.example.repository.show.ShowTicketingTimeRepository; import org.example.repository.show.showartist.ShowArtistRepository; import org.example.repository.show.showgenre.ShowGenreRepository; import org.example.repository.show.showsearch.ShowSearchRepository; +import org.example.vo.TicketingType; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -215,6 +217,22 @@ public List findShowSearchesByShowId(UUID showId) { return showSearchRepository.findAllByShowIdAndIsDeletedFalse(showId); } + public ShowTicketingTime findTicketingAlertReservation( + UUID showId, + TicketingType type + ) { + return showTicketingTimeRepository.findByShowIdAndTicketingTypeAndIsDeletedFalse(showId, type) + .orElseThrow(NoSuchElementException::new); + } + + public ShowTicketingTime findTicketingTimeWithShow( + UUID showId, + TicketingType type + ) { + return showTicketingTimeRepository.findByShowIdAndTicketingTypeWithShow(showId, type) + .orElseThrow(NoSuchElementException::new); + } + private Show findShowOrThrowNoSuchElementException(UUID id) { return showRepository.findById(id).orElseThrow(NoSuchElementException::new); } diff --git a/app/domain/user-domain/src/main/java/org/example/config/UserDomainConfig.java b/app/domain/user-domain/src/main/java/org/example/config/UserDomainConfig.java index 34bd318a..5711a442 100644 --- a/app/domain/user-domain/src/main/java/org/example/config/UserDomainConfig.java +++ b/app/domain/user-domain/src/main/java/org/example/config/UserDomainConfig.java @@ -13,6 +13,8 @@ "org.example.repository.admin", "org.example.repository.subscription", "org.example.repository.interest", + "org.example.repository.subscription", + "org.example.repository.ticketing" }) public class UserDomainConfig { diff --git a/app/domain/user-domain/src/main/java/org/example/dto/request/TicketingAlertReservationDomainRequest.java b/app/domain/user-domain/src/main/java/org/example/dto/request/TicketingAlertReservationDomainRequest.java new file mode 100644 index 00000000..4a08b78d --- /dev/null +++ b/app/domain/user-domain/src/main/java/org/example/dto/request/TicketingAlertReservationDomainRequest.java @@ -0,0 +1,21 @@ +package org.example.dto.request; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.UUID; +import lombok.Builder; +import org.example.vo.TicketingAlertTime; +import org.example.vo.TicketingType; + +@Builder +public record TicketingAlertReservationDomainRequest( + + UUID userId, + UUID showId, + TicketingType type, + String name, + LocalDateTime ticketingAt, + List alertTimes +) { + +} diff --git a/app/domain/user-domain/src/main/java/org/example/dto/response/TicketingAlertsDomainResponse.java b/app/domain/user-domain/src/main/java/org/example/dto/response/TicketingAlertsDomainResponse.java new file mode 100644 index 00000000..9a164af4 --- /dev/null +++ b/app/domain/user-domain/src/main/java/org/example/dto/response/TicketingAlertsDomainResponse.java @@ -0,0 +1,17 @@ +package org.example.dto.response; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.UUID; +import lombok.Builder; + +@Builder +public record TicketingAlertsDomainResponse( + + String userFcmToken, + String name, + UUID showId, + List reservedAts +) { + +} diff --git a/app/domain/user-domain/src/main/java/org/example/entity/TicketingAlert.java b/app/domain/user-domain/src/main/java/org/example/entity/TicketingAlert.java index bb85e5c2..0007ab39 100644 --- a/app/domain/user-domain/src/main/java/org/example/entity/TicketingAlert.java +++ b/app/domain/user-domain/src/main/java/org/example/entity/TicketingAlert.java @@ -6,6 +6,7 @@ import java.time.LocalDateTime; import java.util.UUID; import lombok.AccessLevel; +import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @@ -26,4 +27,17 @@ public class TicketingAlert extends BaseEntity { @Column(name = "show_id", nullable = false) private UUID showId; + + @Builder + private TicketingAlert( + String name, + LocalDateTime alertTime, + UUID userId, + UUID showId + ) { + this.name = name; + this.alertTime = alertTime; + this.userId = userId; + this.showId = showId; + } } diff --git a/app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertQuerydslRepository.java b/app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertQuerydslRepository.java new file mode 100644 index 00000000..7737e38b --- /dev/null +++ b/app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertQuerydslRepository.java @@ -0,0 +1,5 @@ +package org.example.repository.ticketing; + +public interface TicketingAlertQuerydslRepository { + +} diff --git a/app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertQuerydslRepositoryImpl.java b/app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertQuerydslRepositoryImpl.java new file mode 100644 index 00000000..e499a01f --- /dev/null +++ b/app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertQuerydslRepositoryImpl.java @@ -0,0 +1,13 @@ +package org.example.repository.ticketing; + +import com.querydsl.jpa.impl.JPAQueryFactory; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Repository; + +@Repository +@RequiredArgsConstructor +public class TicketingAlertQuerydslRepositoryImpl implements TicketingAlertQuerydslRepository { + + private final JPAQueryFactory jpaQueryFactory; + +} diff --git a/app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertRepository.java b/app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertRepository.java new file mode 100644 index 00000000..80dbcd67 --- /dev/null +++ b/app/domain/user-domain/src/main/java/org/example/repository/ticketing/TicketingAlertRepository.java @@ -0,0 +1,13 @@ +package org.example.repository.ticketing; + +import java.util.List; +import java.util.UUID; +import org.example.entity.TicketingAlert; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface TicketingAlertRepository extends JpaRepository, + TicketingAlertQuerydslRepository { + + List findAllByUserIdAndShowIdAndIsDeletedFalse(UUID userId, UUID showId); + +} diff --git a/app/domain/user-domain/src/main/java/org/example/usecase/TicketingAlertUseCase.java b/app/domain/user-domain/src/main/java/org/example/usecase/TicketingAlertUseCase.java new file mode 100644 index 00000000..c62ef73a --- /dev/null +++ b/app/domain/user-domain/src/main/java/org/example/usecase/TicketingAlertUseCase.java @@ -0,0 +1,107 @@ +package org.example.usecase; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.UUID; +import lombok.RequiredArgsConstructor; +import org.example.dto.request.TicketingAlertReservationDomainRequest; +import org.example.dto.response.TicketingAlertsDomainResponse; +import org.example.entity.BaseEntity; +import org.example.entity.TicketingAlert; +import org.example.repository.ticketing.TicketingAlertRepository; +import org.example.repository.user.UserRepository; +import org.example.vo.TicketingAlertTime; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +@Component +@RequiredArgsConstructor +public class TicketingAlertUseCase { + + private final TicketingAlertRepository ticketingAlertRepository; + private final UserRepository userRepository; + + public List findTicketingAlerts( + UUID userId, + UUID showId + ) { + return ticketingAlertRepository.findAllByUserIdAndShowIdAndIsDeletedFalse(userId, showId); + } + + @Transactional + public TicketingAlertsDomainResponse alertReservation( + TicketingAlertReservationDomainRequest ticketingAlertReservation + ) { + List existingAlerts = ticketingAlertRepository.findAllByUserIdAndShowIdAndIsDeletedFalse( + ticketingAlertReservation.userId(), + ticketingAlertReservation.showId() + ); + + List requestedAlertTimes = ticketingAlertReservation.alertTimes().stream() + .map( + alertTime -> calculateAlertTime(ticketingAlertReservation.ticketingAt(), alertTime)) + .toList(); + + List alertsToKeep = existingAlerts.stream() + .filter(alert -> requestedAlertTimes.contains(alert.getAlertTime())) + .toList(); + + List existingAlertTimes = alertsToKeep.stream() + .map(TicketingAlert::getAlertTime) + .toList(); + + removeAlerts(existingAlerts, requestedAlertTimes); + return addAlerts(ticketingAlertReservation, requestedAlertTimes, existingAlertTimes); + } + + private TicketingAlertsDomainResponse addAlerts( + TicketingAlertReservationDomainRequest ticketingAlertReservation, + List requestedAlertTimes, + List existingAlertTimes + ) { + List alertsToAdd = requestedAlertTimes.stream() + .filter(alertTime -> !existingAlertTimes.contains(alertTime)) + .map(alertTime -> TicketingAlert.builder() + .name(ticketingAlertReservation.name()) + .alertTime(alertTime) + .userId(ticketingAlertReservation.userId()) + .showId(ticketingAlertReservation.showId()) + .build() + ) + .toList(); + ticketingAlertRepository.saveAll(alertsToAdd); + + String fcmToken = userRepository.findUserFcmTokensByUserId( + ticketingAlertReservation.userId()) + .orElseThrow(NoSuchElementException::new); + + return TicketingAlertsDomainResponse.builder() + .userFcmToken(fcmToken) + .name(ticketingAlertReservation.name()) + .showId(ticketingAlertReservation.showId()) + .reservedAts(alertsToAdd.stream() + .map(TicketingAlert::getAlertTime) + .toList() + ) + .build(); + } + + private void removeAlerts( + List existingAlerts, + List requestedAlertTimes + ) { + List alertsToRemove = existingAlerts.stream() + .filter(alert -> !requestedAlertTimes.contains(alert.getAlertTime())) + .toList(); + alertsToRemove.forEach(BaseEntity::softDelete); + } + + private LocalDateTime calculateAlertTime(LocalDateTime showTime, TicketingAlertTime alertTime) { + return switch (alertTime) { + case BEFORE_24 -> showTime.minusHours(24); + case BEFORE_6 -> showTime.minusHours(6); + case BEFORE_1 -> showTime.minusHours(1); + }; + } +} diff --git a/app/domain/user-domain/src/main/java/org/example/vo/TicketingAlertTime.java b/app/domain/user-domain/src/main/java/org/example/vo/TicketingAlertTime.java new file mode 100644 index 00000000..482bab5d --- /dev/null +++ b/app/domain/user-domain/src/main/java/org/example/vo/TicketingAlertTime.java @@ -0,0 +1,7 @@ +package org.example.vo; + +public enum TicketingAlertTime { + BEFORE_24, + BEFORE_6, + BEFORE_1 +} diff --git a/app/domain/user-domain/src/main/java/org/example/vo/TicketingType.java b/app/domain/user-domain/src/main/java/org/example/vo/TicketingType.java new file mode 100644 index 00000000..77a9dad1 --- /dev/null +++ b/app/domain/user-domain/src/main/java/org/example/vo/TicketingType.java @@ -0,0 +1,8 @@ +package org.example.vo; + +public enum TicketingType { + PRE("선예매"), NORMAL("일반예매"), ADDITIONAL("추가예매"); + + TicketingType(String value) { + } +} diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/ReserveShowInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/ReserveShowInfraMessage.java deleted file mode 100644 index 6bd37c2b..00000000 --- a/app/infrastructure/message-queue/src/main/java/org/example/message/ReserveShowInfraMessage.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.example.message; - -import com.example.publish.message.ReserveShowServiceMessage; -import com.example.show.controller.vo.TicketingApiType; -import java.time.LocalDateTime; -import java.util.UUID; -import lombok.Builder; - -@Builder -public record ReserveShowInfraMessage( - LocalDateTime reserveAt, - String showName, - TicketingApiType type, - UUID showId -) { - public static ReserveShowInfraMessage from(ReserveShowServiceMessage message) { - return ReserveShowInfraMessage.builder() - .reserveAt(message.reserveAt()) - .showName(message.showName()) - .type(message.type()) - .showId(message.showId()) - .build(); - } - -} diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingReservationInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingReservationInfraMessage.java index 0b9be9bf..20ef6425 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingReservationInfraMessage.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingReservationInfraMessage.java @@ -1,25 +1,27 @@ package org.example.message; -import com.example.publish.message.TicketingReservationServiceMessage; +import com.example.publish.message.TicketingAlertsToReserveServiceMessage; +import java.time.LocalDateTime; import java.util.List; +import java.util.UUID; import lombok.Builder; @Builder public record TicketingReservationInfraMessage( String userFcmToken, - List reserveShows + String name, + UUID showId, + List reserveAts ) { public static TicketingReservationInfraMessage from( - TicketingReservationServiceMessage message + TicketingAlertsToReserveServiceMessage message ) { return TicketingReservationInfraMessage.builder() .userFcmToken(message.userFcmToken()) - .reserveShows(message.reserveShows() - .stream() - .map(ReserveShowInfraMessage::from) - .toList() - ) + .name(message.name()) + .showId(message.showId()) + .reserveAts(message.reserveAts().stream().map(LocalDateTime::toString).toList()) .build(); } } diff --git a/app/infrastructure/message-queue/src/main/java/org/example/publish/RedisMessagePublisher.java b/app/infrastructure/message-queue/src/main/java/org/example/publish/RedisMessagePublisher.java index c9cf6df2..c16f358d 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/publish/RedisMessagePublisher.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/publish/RedisMessagePublisher.java @@ -4,7 +4,7 @@ import com.example.publish.message.ArtistSubscriptionServiceMessage; import com.example.publish.message.GenreSubscriptionServiceMessage; import com.example.publish.message.ShowRelationArtistAndGenreServiceMessage; -import com.example.publish.message.TicketingReservationServiceMessage; +import com.example.publish.message.TicketingAlertsToReserveServiceMessage; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.example.message.ArtistSubscriptionInfraMessage; @@ -57,7 +57,7 @@ public void publishGenreSubscription( @Override public void publishTicketingReservation( String topic, - TicketingReservationServiceMessage message + TicketingAlertsToReserveServiceMessage message ) { var infraMessage = TicketingReservationInfraMessage.from(message);