-
Notifications
You must be signed in to change notification settings - Fork 4
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
탈퇴 기능 추가 #378
Merged
Merged
탈퇴 기능 추가 #378
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
854c900
feat: 카카오 연결 끊기 기능 추가
JJ503 fa53da7
feat: 탈퇴 기능 서비스 추가
JJ503 692abb0
feat: oauth id에 대한 unique 속성 제거
JJ503 4436508
refactor: 회원과 사용자라는 용어 통일
JJ503 ed70865
feat: 이름이 이미 존재하는지에 대한 확인 쿼리 메서드 추가
JJ503 8635682
feat: 랜덤 이름을 생성하는 util 클래스 추가
JJ503 5aff1f4
feat: 재가입 시 이름에 대한 중복 문제 해결을 위한 로직 추가
JJ503 e20b6e4
feat: 탈퇴한 회원의 이름을 가져오는 경우에 대한 로직 추가
JJ503 621590a
feat: 탈퇴 컨트롤러 기능 추가
JJ503 059f81c
feat: 예외처리 추가
JJ503 6cbadb8
test: 테스트 실패 문제 해결
JJ503 01cccdc
refactor: flyway 버전 수정
JJ503 ea5d5f1
refactor: 탈퇴한 사용자 이름 변경 로직 위치 수정
JJ503 e63f83c
docs: 문서 최신화
JJ503 72ed2e1
refactor: 예외 메시지 클래스명 수정
JJ503 94433a3
refactor: do-while문을 while문으로 수정
JJ503 898cefb
refactor: 탈퇴 시 로직 순서 변경
JJ503 797ceca
style: 해결된 todo 제거
JJ503 ba0ab60
ci: flyway 버전 수정
JJ503 75fd058
ci: 충돌 문제 해결
JJ503 559c0b7
ci: 충돌 문제 해결
JJ503 af0f74e
refactor: 이미지가 null인 경우에 대한 예외처리 추가
JJ503 f70c71a
refactor: util 클래스에 final 추가
JJ503 de24d84
ci: 충돌 문제 해결
JJ503 662b4f7
fix: 경매 이미지 url 경로 누락 문제 해결
JJ503 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...java/com/ddang/ddang/authentication/application/exception/InvalidWithdrawalException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.ddang.ddang.authentication.application.exception; | ||
|
||
public class InvalidWithdrawalException extends IllegalArgumentException { | ||
|
||
public InvalidWithdrawalException(final String message) { | ||
super(message); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ng/src/main/java/com/ddang/ddang/authentication/application/util/RandomNameGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.ddang.ddang.authentication.application.util; | ||
|
||
import java.util.Random; | ||
|
||
public class RandomNameGenerator { | ||
|
||
private static final int NAME_LENGTH = 10; | ||
|
||
private static final Random random = new Random(); | ||
|
||
private RandomNameGenerator() { | ||
} | ||
|
||
public static String generate() { | ||
StringBuilder name = new StringBuilder(); | ||
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. final이 누락되었습니다! 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. 해당 클래스에 전체적으로 final이 누락되었습니다 |
||
|
||
for (int i = 0; i < NAME_LENGTH; i++) { | ||
int digit = random.nextInt(10); | ||
name.append(digit); | ||
} | ||
|
||
return name.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
.../main/java/com/ddang/ddang/authentication/presentation/dto/request/WithdrawalRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.ddang.ddang.authentication.presentation.dto.request; | ||
|
||
import jakarta.validation.constraints.NotEmpty; | ||
|
||
public record WithdrawalRequest(@NotEmpty(message = "refreshToken을 입력해주세요.") String refreshToken) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
backend/ddang/src/main/java/com/ddang/ddang/chat/application/dto/ReadUserInChatRoomDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
package com.ddang.ddang.chat.application.dto; | ||
|
||
import com.ddang.ddang.image.application.util.ImageIdProcessor; | ||
import com.ddang.ddang.user.domain.User; | ||
|
||
public record ReadUserInChatRoomDto(Long id, String name, Long profileImageId, double reliability) { | ||
public record ReadUserInChatRoomDto(Long id, String name, Long profileImageId, double reliability, boolean isDeleted) { | ||
|
||
public static ReadUserInChatRoomDto from(final User user) { | ||
return new ReadUserInChatRoomDto( | ||
user.getId(), | ||
user.getName(), | ||
user.getProfileImage().getId(), | ||
user.getReliability() | ||
ImageIdProcessor.process(user.getProfileImage()), | ||
user.getReliability(), | ||
user.isDeleted() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
근데 순서를 탈퇴 -> 탈퇴로 인한 사용자 레코드 DB 변경
DB 변경에 성공하면 토큰 비활성화 -> 블랙리스트 토큰쪽 DB에 저장
사용자 레코드 DB 변경 + 블랙리스트 토큰 DB 추가가 되면 unlink를 해야 할 것 같습니다
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.
지금 상황은 카카오 연결 끊기는 성공했지만(외부 서비스라 왠만하면 성공할 것 같습니다)
토큰을 블랙리스트에 등록하거나 사용자 탈퇴 처리를 하는 과정 중 문제가 생겨 롤백을 하게 될지라도
카카오는 이미 연결을 끊어버렸기 때문에 소셜 로그인 자체가 불능이 될 것 같습니다