-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from MoneyMakersClub/develop
[Feat] 회원 탈퇴 내부에 로직 추가, 닉네임 관련 API 수정 등 배포
- Loading branch information
Showing
19 changed files
with
174 additions
and
63 deletions.
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
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
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
65 changes: 65 additions & 0 deletions
65
bookduck/src/main/java/com/mmc/bookduck/domain/user/service/UserWithdrawService.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,65 @@ | ||
package com.mmc.bookduck.domain.user.service; | ||
|
||
import com.mmc.bookduck.domain.alarm.service.AlarmService; | ||
import com.mmc.bookduck.domain.badge.service.UserBadgeService; | ||
import com.mmc.bookduck.domain.book.service.BookInfoService; | ||
import com.mmc.bookduck.domain.folder.service.FolderService; | ||
import com.mmc.bookduck.domain.friend.service.FriendRequestService; | ||
import com.mmc.bookduck.domain.friend.service.FriendService; | ||
import com.mmc.bookduck.domain.homecard.service.HomeCardService; | ||
import com.mmc.bookduck.domain.item.service.UserItemService; | ||
import com.mmc.bookduck.domain.user.entity.User; | ||
import com.mmc.bookduck.global.security.CookieUtil; | ||
import com.mmc.bookduck.global.security.RedisService; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Slf4j | ||
@Service | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class UserWithdrawService { | ||
private final UserService userService; | ||
private final RedisService redisService; | ||
private final CookieUtil cookieUtil; | ||
private final FolderService folderService; | ||
private final BookInfoService bookInfoService; | ||
private final UserBadgeService userBadgeService; | ||
private final HomeCardService homeCardService; | ||
private final UserItemService userItemService; | ||
private final FriendRequestService friendRequestService; | ||
private final FriendService friendService; | ||
private final AlarmService alarmService; | ||
|
||
public void withdrawUser(HttpServletResponse response) { | ||
User user = userService.getCurrentUser(); | ||
|
||
log.info("userId: " + user.getUserId() +" | 이메일: " + user.getEmail() + " 회원이 탈퇴했습니다."); | ||
|
||
// 폴더 & 커스텀책 삭제 | ||
folderService.deleteUserFolder(user); | ||
bookInfoService.deleteUserCustomBook(user); | ||
|
||
// 뱃지, 아이템, 카드(위젯) 삭제 | ||
userBadgeService.deleteUserBadgesByUser(user); | ||
userItemService.deletUserItemsByUser(user); | ||
homeCardService.deleteHomeCardsByUser(user); | ||
|
||
// 친구 요청, 친구, 알림 삭제 | ||
friendRequestService.deleteFriendRequestsByUser(user); | ||
friendService.deleteFriendsOfUser(user); | ||
alarmService.deleteAlarmsOfUser(user); | ||
|
||
// 글 삭제 | ||
|
||
// 유저 데이터 삭제 | ||
user.clearUserData();; | ||
userService.saveUser(user); | ||
|
||
redisService.deleteValues(user.getEmail()); | ||
cookieUtil.deleteCookie(response, "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
Oops, something went wrong.