-
Notifications
You must be signed in to change notification settings - Fork 0
feat(rank): 사용자 삭제됐을때, 랭킹에서도 삭제되도록 수정 #273
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
00a8a3c
feat(rank): 랭커 삭제 기능 구현
huhdy32 8202c57
feat(member): 사용자 삭제 시, 이벤트 발행하도록 구현
huhdy32 d560e2b
feat(rank): 멤버 삭제 이벤트 수신해서 랭킹에서 제거하도록 수정
huhdy32 2197c96
refactor(rank): 사용자 찾지 못했을 때, 로그만 남기도록 수정
huhdy32 048884d
fix(rank): 사용자 id 로 찾도록 수정
huhdy32 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
30 changes: 30 additions & 0 deletions
30
...ank-rank-domain/src/main/java/kr/co/mathrank/domain/rank/service/SolverDeleteService.java
This file contains hidden or 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,30 @@ | ||
| package kr.co.mathrank.domain.rank.service; | ||
|
|
||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
| import org.springframework.validation.annotation.Validated; | ||
|
|
||
| import jakarta.validation.Valid; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import kr.co.mathrank.domain.rank.repository.SolverRepository; | ||
| import lombok.RequiredArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
|
|
||
| @Slf4j | ||
| @Service | ||
| @Validated | ||
| @RequiredArgsConstructor | ||
| public class SolverDeleteService { | ||
| private final SolverRepository solverRepository; | ||
|
|
||
| @Transactional | ||
| public void delete(@NotNull @Valid final Long memberId) { | ||
| solverRepository.findByMemberId(memberId) | ||
| .ifPresentOrElse(solver -> { | ||
| solverRepository.delete(solver); | ||
| log.info("[SolverDeleteService.delete] solver deleted - memberId: {}", memberId); | ||
| }, () -> { | ||
| log.info("[SolverDeleteService.delete] cannot found solver - memberId: {}", memberId); | ||
huhdy32 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
| } | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.