Skip to content

[23기_황신애] 성능최적화 미션 제출합니다.#73

Open
shinae1023 wants to merge 10 commits into
CEOS-Developers:shinae1023from
shinae1023:shinae1023
Open

[23기_황신애] 성능최적화 미션 제출합니다.#73
shinae1023 wants to merge 10 commits into
CEOS-Developers:shinae1023from
shinae1023:shinae1023

Conversation

@shinae1023

Copy link
Copy Markdown

No description provided.

whc9999 and others added 7 commits May 15, 2026 17:13
- 로그인 API 추가
- 회원가입 API 추가
- 사용자 엔티티 및 Repository 추가
- Spring Security 및 JWT 인증 설정 추가
- 아이디/이메일 중복 검증 추가
- Swagger 문서 설정 추가

@whc9999 whc9999 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

과제하시느라 수고 많으셨어요~~
세오스 백엔드가 미래다~

Comment on lines +113 to +127
try {
response = paymentService.cancelPayment(reservation.getPaymentId());
} catch (GeneralException e) {
reservationService.markPaymentUnknown(userId, reservationId);
throw e;
}

if (response == null
|| response.data() == null
|| PaymentStatus.from(response.data().paymentStatus()) != PaymentStatus.CANCELLED) {
reservationService.markPaymentUnknown(userId, reservationId);
throw new GeneralException(GeneralErrorCode.PAYMENT_NOT_CANCELLABLE);
}

reservationService.cancelPaidReservationAfterPaymentCancellation(userId, reservationId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PG 취소 실패 또는 비정상 응답 시 reservationService.markPaymentUnknown()을 호출하는데요, 그런데 Reservation.markPaymentUnknown()은 현재 PROCESSING + 대기 상태에서만 허용하도록 바뀌었네요. 완료 예매 취소 케이스는 보통 PAID + 완료라서, PG 취소 실패를 UNKNOWN으로 남기려는 순간 PAYMENT_NOT_READY가 다시 터질 수 있을 것 같습니다...

취소 실패용 상태 전이는 PAID/완료 -> UNKNOWN을 허용하거나, “결제 승인 실패 UNKNOWN”과 “결제 취소 실패 UNKNOWN”을 별도 메서드/상태로 분리하는게 어떨까요??

Comment on lines +121 to +126
|| response.data() == null
|| PaymentStatus.from(response.data().paymentStatus()) != PaymentStatus.CANCELLED) {
reservationService.markPaymentUnknown(userId, reservationId);
throw new GeneralException(GeneralErrorCode.PAYMENT_NOT_CANCELLABLE);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

외부 시스템 응답 파싱은 실패 가능성이 있으니, 파싱 예외까지 잡아서 UNKNOWN 처리 후 도메인 예외로 변환하는 흐름이 어떨까용?

Comment on lines 15 to 18
public void expirePendingReservationsAndFoodOrders() {
expirePendingReservations();
expirePendingFoodOrders();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 만료 배치를 서비스로 분리 했군요. 근데 예매 만료에서 예외가 나면 매점 주문 만료는 실행되지 않을 것 같아요. 각 호출을 try/catch로 감싸서 실패 로그를 남기고 다음 작업은 계속 수행하거나, 스케줄러 자체를 분리하는게 어떨까요??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants