diff --git a/gateway/src/main/java/com/ticketPing/gateway/application/client/AuthClient.java b/gateway/src/main/java/com/ticketPing/gateway/application/client/AuthClient.java index 87c8d404..00b8598f 100644 --- a/gateway/src/main/java/com/ticketPing/gateway/application/client/AuthClient.java +++ b/gateway/src/main/java/com/ticketPing/gateway/application/client/AuthClient.java @@ -4,5 +4,5 @@ import reactor.core.publisher.Mono; public interface AuthClient { - public Mono validateToken(String token); + Mono validateToken(String token); } diff --git a/gateway/src/main/java/com/ticketPing/gateway/infrastructure/filter/QueueCheckFilter.java b/gateway/src/main/java/com/ticketPing/gateway/infrastructure/filter/QueueCheckFilter.java index ef7dfbb8..4c6a3376 100644 --- a/gateway/src/main/java/com/ticketPing/gateway/infrastructure/filter/QueueCheckFilter.java +++ b/gateway/src/main/java/com/ticketPing/gateway/infrastructure/filter/QueueCheckFilter.java @@ -33,7 +33,7 @@ public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { switch (api) { case ENTER_WAITING_QUEUE -> handleEnterWaitingQueueApi(exchange, chain); case GET_QUEUE_INFO -> handleGetQueueInfoApi(exchange, chain); - case PRE_RESERVE_SEAT, CREATE_ORDER, VALIDATE_ORDER -> handleCreateOrderApi(exchange, chain); + case PRE_RESERVE_SEAT, CREATE_ORDER, VALIDATE_ORDER -> handleReservationApi(exchange, chain); }) .switchIfEmpty(chain.filter(exchange)); } @@ -53,7 +53,7 @@ private Mono handleGetQueueInfoApi(ServerWebExchange exchange, GatewayFilt .then(chain.filter(exchange)); } - private Mono handleCreateOrderApi(ServerWebExchange exchange, GatewayFilterChain chain) { + private Mono handleReservationApi(ServerWebExchange exchange, GatewayFilterChain chain) { return Mono.zip( getPerformanceIdFromQueryParams(exchange), getUserIdFromAuthentication() diff --git a/services/auth/src/main/java/com/ticketPing/auth/infrastructure/service/RedisCacheService.java b/services/auth/src/main/java/com/ticketPing/auth/infrastructure/service/RedisCacheService.java index 4a85e1bb..40ceaf72 100644 --- a/services/auth/src/main/java/com/ticketPing/auth/infrastructure/service/RedisCacheService.java +++ b/services/auth/src/main/java/com/ticketPing/auth/infrastructure/service/RedisCacheService.java @@ -21,7 +21,6 @@ public class RedisCacheService implements CacheService { public void saveRefreshToken(UUID userId, String refreshToken) { String key = generateKey(userId); - System.out.println(REFRESH_TOKEN_EXPIRATION); redisRepository.setValueWithTTL(key, refreshToken, Duration.ofMillis(REFRESH_TOKEN_EXPIRATION)); } diff --git a/services/payment/src/main/java/com/ticketPing/payment/application/service/PaymentApplicationService.java b/services/payment/src/main/java/com/ticketPing/payment/application/service/PaymentApplicationService.java index 4f7a13b4..ec499e66 100644 --- a/services/payment/src/main/java/com/ticketPing/payment/application/service/PaymentApplicationService.java +++ b/services/payment/src/main/java/com/ticketPing/payment/application/service/PaymentApplicationService.java @@ -84,5 +84,6 @@ public PaymentResponse getCompletedPaymentByOrderId(UUID orderId) { Payment payment = paymentDomainService.getCompletedPaymentByOrderId(orderId); return PaymentResponse.from(payment); } + } diff --git a/services/payment/src/main/java/com/ticketPing/payment/domain/service/PaymentDomainService.java b/services/payment/src/main/java/com/ticketPing/payment/domain/service/PaymentDomainService.java index 17af2ac9..e803d7c4 100644 --- a/services/payment/src/main/java/com/ticketPing/payment/domain/service/PaymentDomainService.java +++ b/services/payment/src/main/java/com/ticketPing/payment/domain/service/PaymentDomainService.java @@ -32,4 +32,5 @@ public Payment getCompletedPaymentByOrderId(UUID orderId) { return paymentRepository.findByOrderIdAndStatus(orderId, PaymentStatus.COMPLETED) .orElseThrow(() -> new ApplicationException(PAYMENT_NOT_FOUND)); } + } \ No newline at end of file diff --git a/services/payment/src/main/java/com/ticketPing/payment/presentation/controller/PaymentController.java b/services/payment/src/main/java/com/ticketPing/payment/presentation/controller/PaymentController.java index 2c8e33ad..74ea242c 100644 --- a/services/payment/src/main/java/com/ticketPing/payment/presentation/controller/PaymentController.java +++ b/services/payment/src/main/java/com/ticketPing/payment/presentation/controller/PaymentController.java @@ -32,14 +32,14 @@ public ResponseEntity> confirmPayment(@Valid @Request @Operation(summary = "결제 단일 조회 (Feign)") @GetMapping("/{paymentId}") - public ResponseEntity> getPayment( + public ResponseEntity> getPaymentInfo( @Valid @PathVariable("paymentId") UUID paymentId) { return ResponseEntity .status(200) .body(success(paymentApplicationService.getPayment(paymentId))); } - @Operation(summary = "성공 예매 확인") + @Operation(summary = "결제 성공 확인 (Feign)") @GetMapping("/completed") public ResponseEntity> getCompletedPaymentByOrderId( @Valid @RequestParam("orderId") UUID orderId) { diff --git a/services/performance/src/main/java/com/ticketPing/performance/application/service/SeatService.java b/services/performance/src/main/java/com/ticketPing/performance/application/service/SeatService.java index 68687cb0..506f6e21 100644 --- a/services/performance/src/main/java/com/ticketPing/performance/application/service/SeatService.java +++ b/services/performance/src/main/java/com/ticketPing/performance/application/service/SeatService.java @@ -8,7 +8,6 @@ import com.ticketPing.performance.domain.model.enums.SeatStatus; import com.ticketPing.performance.domain.repository.CacheRepository; import com.ticketPing.performance.domain.repository.SeatRepository; -import com.ticketPing.performance.infrastructure.service.LuaScriptService; import exception.ApplicationException; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -81,7 +80,6 @@ private Seat getSeatWithDetails(UUID seatId) { .orElseThrow(() -> new ApplicationException(SeatExceptionCase.SEAT_NOT_FOUND)); } - @Transactional private void reserveSeatInDB(String seatId) { Seat seat = seatRepository.findById(UUID.fromString(seatId)) .orElseThrow(() -> new ApplicationException(SeatExceptionCase.SEAT_NOT_FOUND)); @@ -89,7 +87,7 @@ private void reserveSeatInDB(String seatId) { } private void validatePreserve(UUID scheduleId, UUID seatId, UUID userId) { - String preReserveUserId = cacheRepository.getPreReservTTL(scheduleId, seatId); + String preReserveUserId = cacheRepository.getPreReserveUserId(scheduleId, seatId); if(!preReserveUserId.equals(userId.toString())) throw new ApplicationException(SeatExceptionCase.USER_NOT_MATCH); } diff --git a/services/performance/src/main/java/com/ticketPing/performance/domain/repository/CacheRepository.java b/services/performance/src/main/java/com/ticketPing/performance/domain/repository/CacheRepository.java index bff5a37c..c6a9f7a3 100644 --- a/services/performance/src/main/java/com/ticketPing/performance/domain/repository/CacheRepository.java +++ b/services/performance/src/main/java/com/ticketPing/performance/domain/repository/CacheRepository.java @@ -17,7 +17,7 @@ public interface CacheRepository { void preReserveSeatCache(UUID scheduleId, UUID seatId, UUID userId); - String getPreReservTTL(UUID scheduleId, UUID seatId); + String getPreReserveUserId(UUID scheduleId, UUID seatId); void extendPreReserveTTL(UUID scheduleId, UUID seatId, Duration ttl); diff --git a/services/performance/src/main/java/com/ticketPing/performance/domain/repository/ScheduleRepository.java b/services/performance/src/main/java/com/ticketPing/performance/domain/repository/ScheduleRepository.java index 6000dc01..5029393e 100644 --- a/services/performance/src/main/java/com/ticketPing/performance/domain/repository/ScheduleRepository.java +++ b/services/performance/src/main/java/com/ticketPing/performance/domain/repository/ScheduleRepository.java @@ -1,10 +1,4 @@ package com.ticketPing.performance.domain.repository; -import com.ticketPing.performance.domain.model.entity.Schedule; - -import java.util.Optional; -import java.util.UUID; - public interface ScheduleRepository { - Optional findById(UUID id); } diff --git a/services/performance/src/main/java/com/ticketPing/performance/infrastructure/repository/CacheRepositoryImpl.java b/services/performance/src/main/java/com/ticketPing/performance/infrastructure/repository/CacheRepositoryImpl.java index 154f1ef8..a0eba568 100644 --- a/services/performance/src/main/java/com/ticketPing/performance/infrastructure/repository/CacheRepositoryImpl.java +++ b/services/performance/src/main/java/com/ticketPing/performance/infrastructure/repository/CacheRepositoryImpl.java @@ -57,7 +57,7 @@ public void preReserveSeatCache(UUID scheduleId, UUID seatId, UUID userId) { luaScriptService.preReserveSeat(scheduleId, seatId, userId); } - public String getPreReservTTL(UUID scheduleId, UUID seatId) { + public String getPreReserveUserId(UUID scheduleId, UUID seatId) { String ttlKey = PRE_RESERVE_SEAT_KEY + ":{" + scheduleId + "}:" + seatId; RBucket bucket = redissonClient.getBucket(ttlKey); return Optional.ofNullable(bucket.get())