-
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
[Feat/member] 회원 탈퇴 기능 구현 #93
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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 |
---|---|---|
|
@@ -73,6 +73,10 @@ public void delete(ChildDeleteParam param) { | |
member.removeChild(param.childId()); | ||
} | ||
|
||
public void removeChild(long memberId) { | ||
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.
|
||
childRepository.deleteByMemberId(memberId); | ||
} | ||
|
||
@Transactional | ||
public Long modify(ChildModifyParam param) { | ||
Member member = getMember(param.memberId()); | ||
|
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
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
56 changes: 56 additions & 0 deletions
56
src/main/java/org/guzzing/studayserver/domain/member/service/MemberFacade.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,56 @@ | ||
package org.guzzing.studayserver.domain.member.service; | ||
|
||
import java.util.List; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.guzzing.studayserver.domain.calendar.service.AcademyCalendarService; | ||
import org.guzzing.studayserver.domain.child.service.ChildService; | ||
import org.guzzing.studayserver.domain.child.service.result.ChildrenFindResult.ChildFindResult; | ||
import org.guzzing.studayserver.domain.dashboard.service.DashboardService; | ||
import org.guzzing.studayserver.domain.like.service.LikeService; | ||
import org.guzzing.studayserver.domain.review.service.ReviewService; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Slf4j | ||
@Component | ||
public class MemberFacade { | ||
|
||
private final MemberService memberService; | ||
private final ChildService childService; | ||
private final AcademyCalendarService calendarService; | ||
private final DashboardService dashboardService; | ||
private final LikeService likeService; | ||
private final ReviewService reviewService; | ||
|
||
public MemberFacade( | ||
final MemberService memberService, | ||
final ChildService childService, | ||
final AcademyCalendarService calendarService, | ||
final DashboardService dashboardService, | ||
final LikeService likeService, | ||
final ReviewService reviewService | ||
) { | ||
this.memberService = memberService; | ||
this.childService = childService; | ||
this.calendarService = calendarService; | ||
this.dashboardService = dashboardService; | ||
this.likeService = likeService; | ||
this.reviewService = reviewService; | ||
} | ||
|
||
@Transactional | ||
public void removeMember(final long memberId) { | ||
List<Long> childIds = childService.findByMemberId(memberId).children() | ||
.stream() | ||
.map(ChildFindResult::childId) | ||
.toList(); | ||
|
||
reviewService.removeReview(memberId); | ||
likeService.removeLike(memberId); | ||
calendarService.removeCalendar(childIds); | ||
dashboardService.removeDashboard(childIds); | ||
childService.removeChild(memberId); | ||
memberService.remove(memberId); | ||
} | ||
|
||
} |
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
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.
이렇게도 사용할 수 있지 않나요?
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.
오 그러네요
in 키워드가 없을 수가 없는뎅..
그래도 확실하게 쿼리문으로 해결해보고 싶습니다!!