-
Notifications
You must be signed in to change notification settings - Fork 1
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: 멤버 탈퇴 api 구현 #38
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.
lgtm
다만 한 가지 논의해야 하는 것이... soft delete vs hard delete인데요,
서버끼리 한번 이야기해봐야 할 것 같습니다.
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.
soft delete 하도록 수정했습니다
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.
멤버 탈퇴 시 재가입이 가능하도록 로그인 fetchOrCreate
쪽 로직에서 멤버 fetch할 때 일반 상태만 가져오도록 해서, deleted인 경우 create 로직 타도록 변경해주세요.
@@ -86,4 +89,15 @@ public static Member createGuestMember(String oauthId) { | |||
.status(MemberStatus.NORMAL) | |||
.build(); | |||
} | |||
|
|||
public void softDelete() { | |||
if (this.status.isDeleted()) { |
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.
if (this.status.isDeleted()) { | |
if (isDeleted()) { |
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.
soft delete와 hard delete는 DB 상에서의 삭제 구현 방식에 대한 논의이지,
애플리케이션 단에서 특수하게 둘을 구분할 필요가 없고 구분해야 하는 요구사항도 없습니다.
애플리케이션에서 예외 상황을 구별해야 한다면 삭제 했냐 / 안했냐에 대한 문제이지 DB 삭제 방식까지 구별해야 하는 것은 아닙니다.
요약하자면 우리 서비스에서 soft delete / hard delete 라는 지식을 가지고 있을 필요가 없습니다. 오히려 도메인 메서드나 예외 코드가 고정되어 버리면 추후 하드 딜리트로 넘어가는 상황에서 대처하기도 어렵습니다. 이 부분에 대해서 수정이 필요해 보입니다.
@@ -86,4 +89,15 @@ public static Member createGuestMember(String oauthId) { | |||
.status(MemberStatus.NORMAL) | |||
.build(); | |||
} | |||
|
|||
public void softDelete() { |
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 softDelete() { | |
public void withdraw() { |
의미를 더 잘 드러낼 수 있는 메서드 이름을 써주면 좋을 것 같습니다.
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.
이 부분만 수정하고 머지하심 될 듯합니다~
|
||
// Member | ||
MEMBER_NOT_FOUND(HttpStatus.NOT_FOUND, "존재하지 않는 회원입니다."), | ||
MEMBER_DELETED(HttpStatus.BAD_REQUEST, "탈퇴한 회원입니다."); |
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.
409 Conflict가 더 적절해보입니다.
🌱 관련 이슈
📌 작업 내용 및 특이사항