Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/main/java/com/mr/domain/auth/service/AuthService.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import com.mr.domain.subscriptions.repository.SubscriptionRepository;
import com.mr.domain.user.repository.StudentInstrumentRepository;
import com.mr.domain.user.repository.StudentRepository;
import com.mr.domain.user.repository.UsageLimitRepository;
import com.mr.domain.weakness.repository.WeaknessNoteRepository;

@Service
Expand All @@ -50,7 +49,6 @@ public class AuthService {
private final OAuthClientService oAuthClientService;
private final AuthTransactionService authTransactionService;
private final OAuthTempCodeStore tempCodeStore;

private final StudentInstrumentRepository studentInstrumentRepository;
private final StudentRepository studentRepository;
private final UserLearningProgressRepository userLearningProgressRepository;
Expand All @@ -68,7 +66,6 @@ public class AuthService {
private final UserStatisticsRepository userStatisticsRepository;
private final SubscriptionRepository subscriptionRepository;
private final WeaknessNoteRepository weaknessNoteRepository;
private final UsageLimitRepository usageLimitRepository;

@Transactional(propagation = Propagation.NOT_SUPPORTED)
public AuthResponseDTO.LoginResponse socialLogin(SocialType socialType, String accessToken, String deviceInfo) {
Expand Down Expand Up @@ -161,7 +158,6 @@ public void withdraw(Long userId) {
User user = userRepository.findById(userId)
.orElseThrow(() -> new GeneralException(UserErrorStatus.USER_NOT_FOUND));

// 1. 연관된 모든 자식 엔티티 데이터 선삭제 (FK 제약조건 예방)
studentInstrumentRepository.deleteAllByUserId(userId);
studentRepository.deleteAllByUserId(userId);

Expand All @@ -187,22 +183,16 @@ public void withdraw(Long userId) {
userStatisticsRepository.deleteAllByUserId(userId);

subscriptionRepository.deleteAllByUserId(userId);
usageLimitRepository.deleteAllByUserId(userId);

// 2. SocialAuth 삭제
List<SocialAuth> socialAuths = socialAuthRepository.findAllByUser_UserId(userId);
if (!socialAuths.isEmpty()) {
socialAuths.forEach(SocialAuth::expireToken);
socialAuthRepository.deleteAll(socialAuths);
}

// 3. User 엔티티 최종 삭제
userRepository.delete(user);
}

// ⚠️ 이 어노테이션을 지우면 클래스 레벨 @Transactional(readOnly=true)를 그대로 상속받아
Comment thread
kimyw1018 marked this conversation as resolved.
// SocialAuth INSERT/UPDATE가 read-only 트랜잭션에서 실패한다 (#94 배포 서버 503 원인).
// AuthServiceTest는 클래스 전체가 @Transactional로 감싸져 있어 이 회귀를 못 잡으니 주의.
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public AuthResponseDTO.LoginResponse exchangeTempCode(String tempCode) {
if (tempCode == null || tempCode.isBlank()) {
Expand Down
109 changes: 0 additions & 109 deletions src/main/java/com/mr/domain/user/entity/UsageLimit.java

This file was deleted.

This file was deleted.

This file was deleted.