-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat : 쿠폰 복구 로직 구현 #201
feat : 쿠폰 복구 로직 구현 #201
Conversation
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.
굿~
public class RecoveryCouponService { | ||
private final IssuedCouponAdaptor issuedCouponAdaptor; | ||
|
||
@RedissonLock(LockName = "쿠폰회복", identifier = "couponId") |
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.
아 전에 민준이랑 얘기하던 거 기억난다. 고쳐서 올렸어유~~
public void recovery() { | ||
usageStatus = false; | ||
} |
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.
이부분을 나중에 테스팅한다고 가정했을 때
테스트 가능하게 할려면
usageStatus 가 이미 false 였을 때
회복불가능한 쿠폰이라고 오류를 뿜어줘야
동시성 테스팅이 가능할 것 같아요
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.
분산락 일단 걸어두긴해서 동시성 테스트 여기도 들어가겠네요. 수정해서 올렸습니다! 굳굳
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
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.
LGTM 👍
개요
작업사항
분산락 걸긴했는데 복구 쪽이라 꼭 걸어야 될 필요는 없어보여요. 일단 돈 관련된 곳이라 걸어두긴 했습니다ㅎㅎ
WithDrawOrderEvent에 쿠폰 관련 값들이 필요해 CreateOrderEvent에서 관련 값들 보고 맞춰서 구현했습니다.
변경로직