From c202c970ad66789f58871bc0e3051b89e96ae837 Mon Sep 17 00:00:00 2001 From: hocaron Date: Fri, 8 Mar 2024 23:21:42 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=9A=8C=EC=9B=90=20=ED=83=88=ED=87=B4?= =?UTF-8?q?=20=EC=8B=9C,=20Attendance=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/attendance/AttendanceRepository.java | 4 +++- .../kr/mashup/branding/service/member/MemberService.java | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mashup-domain/src/main/java/kr/mashup/branding/repository/attendance/AttendanceRepository.java b/mashup-domain/src/main/java/kr/mashup/branding/repository/attendance/AttendanceRepository.java index d0506c980..65a205b9c 100644 --- a/mashup-domain/src/main/java/kr/mashup/branding/repository/attendance/AttendanceRepository.java +++ b/mashup-domain/src/main/java/kr/mashup/branding/repository/attendance/AttendanceRepository.java @@ -14,8 +14,10 @@ public interface AttendanceRepository extends JpaRepository, C Optional findByMemberAndEvent(Member member, Event event); List findAllByMember(Member member); + void deleteByMember(Member member); + } /** * Attendance 연관관계 * many to one: member, event - */ \ No newline at end of file + */ diff --git a/mashup-domain/src/main/java/kr/mashup/branding/service/member/MemberService.java b/mashup-domain/src/main/java/kr/mashup/branding/service/member/MemberService.java index 6bdfa0681..3b49e9e14 100644 --- a/mashup-domain/src/main/java/kr/mashup/branding/service/member/MemberService.java +++ b/mashup-domain/src/main/java/kr/mashup/branding/service/member/MemberService.java @@ -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; @@ -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; @@ -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") @@ -176,6 +178,7 @@ public void deleteMember(Long memberId) { memberPopupRepository.deleteByMember(member); memberGenerationRepository.deleteByMember(member); scoreHistoryRepository.deleteByMember(member); + attendanceRepository.deleteByMember(member); memberRepository.delete(member); }