-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#46] 경매 상품 결제(포인트) 기능 추가 #47
Changes from 1 commit
07db482
a7f1358
92ffb6d
a01c0d0
ba26c10
448808b
0aabd8b
772d18d
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 |
---|---|---|
|
@@ -36,7 +36,13 @@ public int deductPoint(CustomUserDetails userDetails, PointAmount pointAmount) { | |
|
||
point.minus(pointAmount.getAmount()); | ||
return point.getAmount(); | ||
} | ||
|
||
// 포인트 롤백 | ||
@Transactional | ||
public void rollbackPoint(Long userId, int plusAmount) { | ||
Point point = pointRepository.findByUserId(userId); | ||
point.plus(plusAmount); | ||
} | ||
|
||
private static void validateDeductPoint(PointAmount pointAmount, User user, Point point) { | ||
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. 배치에서 차감을 한다고 할 때, 이 사람이 다른 경매도 참여해서 실제 결제시에는 포인트가 부족할 수도 있겠네요! 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. 경매 입찰 시도할때 가격만큼 포인트에서 차감을 시킨 다음에 낙찰받지 못하면 다시 포인트 돌려주는 방식으로 포인트 부족 문제를 해결할 수 있을꺼같은데 이 방식은 어떤지 궁금합니다! 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. 요건 저번 멘토링때 얘기 나눴던 것 같네요! 전 좋은 방법 같습니다! 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. 넵 감사합니다! |
||
|
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.
redis 최고가 정보 변경 전에 포인트를 롤백해주도록 추가했습니다.
이러면 실제 결제 시 포인트 부족 문제를 해결할 수 있을 것 같습니다!
혹시 제가 놓치고 있는 부분이 있을까요?!
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.
지금은 괜찮아보여요!
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.
넵 감사합니다~!