Skip to content

Commit

Permalink
fix: 회원 탈퇴 시, Attendance 데이터 삭제처리
Browse files Browse the repository at this point in the history
  • Loading branch information
hocaron committed Mar 8, 2024
1 parent 9fb1287 commit c202c97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ public interface AttendanceRepository extends JpaRepository<Attendance, Long>, C
Optional<Attendance> findByMemberAndEvent(Member member, Event event);
List<Attendance> findAllByMember(Member member);

void deleteByMember(Member member);

}
/**
* Attendance 연관관계
* many to one: member, event
*/
*/
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import java.util.List;
import java.util.stream.Collectors;

import kr.mashup.branding.domain.BaseEntity;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import kr.mashup.branding.domain.BaseEntity;
import kr.mashup.branding.domain.ResultCode;
import kr.mashup.branding.domain.exception.BadRequestException;
import kr.mashup.branding.domain.exception.GenerationIntegrityFailException;
Expand All @@ -23,6 +24,7 @@
import kr.mashup.branding.domain.member.exception.MemberLoginFailException;
import kr.mashup.branding.domain.member.exception.MemberNotFoundException;
import kr.mashup.branding.domain.member.exception.MemberPendingException;
import kr.mashup.branding.repository.attendance.AttendanceRepository;
import kr.mashup.branding.repository.danggn.DanggnNotificationMemberRecordRepository;
import kr.mashup.branding.repository.danggn.DanggnScoreRepository;
import kr.mashup.branding.repository.danggn.DanggnShakeLogRepository;
Expand All @@ -34,12 +36,12 @@
import kr.mashup.branding.util.DateUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;

@Service
@Slf4j
@RequiredArgsConstructor
public class MemberService {
private final AttendanceRepository attendanceRepository;

private final MemberRepository memberRepository;
@Qualifier("fourTimesRoundPasswordEncoder")
Expand Down Expand Up @@ -176,6 +178,7 @@ public void deleteMember(Long memberId) {
memberPopupRepository.deleteByMember(member);
memberGenerationRepository.deleteByMember(member);
scoreHistoryRepository.deleteByMember(member);
attendanceRepository.deleteByMember(member);

memberRepository.delete(member);
}
Expand Down

0 comments on commit c202c97

Please sign in to comment.