-
Notifications
You must be signed in to change notification settings - Fork 2
prod : 알림톡 factory, 내에 알림톡 변수를 만들 때, 가상계좌에 대한 부분으로 join 하도록 변경 #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -115,6 +115,24 @@ Optional<ExamApplicationNotifyProjection> findExamAndPaymentByExamApplicationId( | |||||||||
| @Param("targetId") Long targetId); | ||||||||||
|
|
||||||||||
|
|
||||||||||
| @Query(""" | ||||||||||
| SELECT new life.mosu.mosuserver.domain.examapplication.projection.ExamApplicationNotifyProjection( | ||||||||||
| va.orderId, | ||||||||||
| e.examDate, | ||||||||||
| e.schoolName, | ||||||||||
| ea.isLunchChecked, | ||||||||||
| e.lunchName | ||||||||||
| ) | ||||||||||
| FROM ExamApplicationJpaEntity ea | ||||||||||
| JOIN ExamJpaEntity e ON ea.examId = e.id | ||||||||||
| JOIN VirtualAccountLogJpaEntity va ON va.applicationId = ea.applicationId | ||||||||||
| WHERE ea.id = :examApplicationId | ||||||||||
| AND va.depositStatus = 'DONE' | ||||||||||
| """) | ||||||||||
| Optional<ExamApplicationNotifyProjection> findExamAndVirtualAccountByExamApplicationId( | ||||||||||
| @Param("examApplicationId") Long examApplicationId); | ||||||||||
|
Comment on lines
+132
to
+133
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 현재 쿼리는 데이터 무결성이 깨지는 예외적인 상황에 대한 방어 코드를 추가하는 것이 좋습니다. 반환 타입을
Suggested change
|
||||||||||
|
|
||||||||||
|
|
||||||||||
| @Query(""" | ||||||||||
| SELECT new life.mosu.mosuserver.domain.examapplication.projection.ExamInfoProjection( | ||||||||||
| e.examDate, | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리포지토리 메서드의 반환 타입이
List로 변경됨에 따라, 여기서도 결과를 리스트로 받고 첫 번째 요소를 사용하도록 수정해야 합니다. 리스트가 비어있는 경우 기존과 동일하게 예외를 발생시킵니다.이렇게 하면
IncorrectResultSizeDataAccessException발생을 방지하고, 비정상적인 데이터가 존재하더라도 첫 번째 유효한 데이터를 기준으로 알림을 보낼 수 있어 시스템 안정성을 높일 수 있습니다.