Skip to content

Commit

Permalink
feat: 회원 완전 탈퇴 테스트 API 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-seong committed Feb 11, 2024
1 parent 03cfc59 commit 9fd17d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ApiResponse<UserResponseDTO.UserDetailDTO> modifyUser(@RequestBody UserRe
@PutMapping("/hard-delete")
@Operation(summary = "회원 완전 탈퇴 테스트 API",description = "30일 뒤에 자동 완전삭제 수동 테스트")
public ApiResponse<String> hardDeleteTest(){
userService.deleteInactiveUsers() ;
userService.deleteInactiveUsersTest();
return ApiResponse.onSuccess("삭제완");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ public interface UserService {
public User withdrawUser();

public void deleteInactiveUsers();

public void deleteInactiveUsersTest();
public User modifyUser(UserRequestDTO.ModifyUserDTO modifyUserDTO);
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ public void deleteInactiveUsers() {
inactiveUsers.forEach(userRepository::delete);
inactiveUsers.forEach(this::disconnectApp);
}
@Transactional
public void deleteInactiveUsersTest() {
LocalDateTime oneMonthAgo = LocalDateTime.now();
List<User> inactiveUsers = userRepository.findByStatusAndInactiveDateBefore(Status.INACTIVE, oneMonthAgo);
inactiveUsers.forEach(userRepository::delete);
inactiveUsers.forEach(this::disconnectApp);
}
// 유저 소셜계정 앱 연동 해지
private void disconnectApp(User user){
SocialType socialType = user.getSocialType();
Expand Down

0 comments on commit 9fd17d7

Please sign in to comment.