[회원 조회 개선] loadUserByUsername 메서드에서 사용자 조회 실패 시 발생하는 예외 메시지를 한국어로 변경

This commit is contained in:
2025-08-22 10:17:12 +09:00
parent f9cd84f740
commit 9e7929da6b

View File

@@ -32,9 +32,8 @@ public class MemberServiceImpl implements MemberService {
@Override @Override
public UserDetails loadUserByUsername(String id) throws UsernameNotFoundException { public UserDetails loadUserByUsername(String id) throws UsernameNotFoundException {
// JPA 레파지토리를 사용하여 회원 조회
Member member = memberRepository.findByUserId(id) Member member = memberRepository.findByUserId(id)
.orElseThrow(() -> new UsernameNotFoundException("User not found with id : " + id)); .orElseThrow(() -> new UsernameNotFoundException("사용자를 찾을 수 없습니다: " + id));
// MapStruct를 사용하여 Member 엔티티를 MemberDto로 변환 // MapStruct를 사용하여 Member 엔티티를 MemberDto로 변환
MemberDto memberDto = memberMapper.toMemberDto(member); MemberDto memberDto = memberMapper.toMemberDto(member);