Skip to content

Commit

Permalink
fix: #70 회원탈퇴 시 FK constraints 에러 발생하는 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Wo-ogie committed May 19, 2024
1 parent 5088146 commit 8d46b59
Showing 1 changed file with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
package com.ajou.hertz.domain.user.service;

import java.util.UUID;

import com.ajou.hertz.domain.instrument.service.InstrumentCommandService;
import com.ajou.hertz.domain.instrument.service.InstrumentQueryService;
import com.ajou.hertz.domain.practice_room.entity.PracticeRoom;
import com.ajou.hertz.domain.practice_room.service.PracticeRoomCommandService;
import com.ajou.hertz.domain.practice_room.service.PracticeRoomQueryService;
import com.ajou.hertz.domain.user.controller.UpdatePasswordWithoutAuthenticationRequest;
import com.ajou.hertz.domain.user.exception.UserDeletionPermissionDeniedException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;

import com.ajou.hertz.common.kakao.dto.response.KakaoUserInfoResponse;
import com.ajou.hertz.common.properties.HertzProperties;
import com.ajou.hertz.domain.instrument.service.InstrumentCommandService;
import com.ajou.hertz.domain.practice_room.service.PracticeRoomCommandService;
import com.ajou.hertz.domain.user.constant.Gender;
import com.ajou.hertz.domain.user.controller.UpdatePasswordWithoutAuthenticationRequest;
import com.ajou.hertz.domain.user.dto.UserDto;
import com.ajou.hertz.domain.user.dto.request.SignUpRequest;
import com.ajou.hertz.domain.user.entity.User;
import com.ajou.hertz.domain.user.exception.UserDeletionPermissionDeniedException;
import com.ajou.hertz.domain.user.exception.UserEmailDuplicationException;
import com.ajou.hertz.domain.user.exception.UserKakaoUidDuplicationException;
import com.ajou.hertz.domain.user.exception.UserPhoneDuplicationException;
import com.ajou.hertz.domain.user.repository.UserRepository;

import lombok.RequiredArgsConstructor;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;

import java.util.UUID;

@RequiredArgsConstructor
@Transactional
Expand Down Expand Up @@ -205,8 +200,8 @@ public void deleteUser(Long requesterId, Long userId) {
practiceRoomCommandService.removeSellerFromPracticeRooms(userId);
// TODO: 공연장(ConcertHall)에서 유저 제거 (연관관계 끊기)

userRepository.deleteById(userId);
userProfileImageCommandService.deleteImagesByUserId(userId);
userRepository.deleteById(userId);

// TODO: 유저 탈퇴 이력 저장
}
Expand Down

0 comments on commit 8d46b59

Please sign in to comment.