Skip to content

Commit

Permalink
feat: 회원 탈퇴시 로깅
Browse files Browse the repository at this point in the history
  • Loading branch information
xxeol2 committed Sep 15, 2023
1 parent fc009ed commit a8dae2c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
import com.festago.common.exception.NotFoundException;
import com.festago.member.domain.Member;
import com.festago.member.repository.MemberRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class AuthService {

private static final Logger log = LoggerFactory.getLogger(AuthService.class);

private final MemberRepository memberRepository;

public AuthService(MemberRepository memberRepository) {
Expand All @@ -35,6 +39,12 @@ private Member signUp(UserInfo userInfo) {
public void deleteMember(Long memberId) {
Member member = memberRepository.findById(memberId)
.orElseThrow(() -> new NotFoundException(ErrorCode.MEMBER_NOT_FOUND));
logDeleteMember(member);
memberRepository.delete(member);
}

private void logDeleteMember(Member member) {
log.info("[DELETE MEMBER] memberId: {} / socialType: {} / socialId: {}",
member.getId(), member.getSocialType(), member.getSocialId());
}
}

0 comments on commit a8dae2c

Please sign in to comment.