[회원 서비스 개선] MemberService와 MemberServiceImpl에서 updateMember 및 deleteRefreshToken 메서드의 반환 타입을 void로 변경하고, 메서드 순서를 정리하여 코드 가독성을 향상시킴.

This commit is contained in:
2025-08-28 16:21:48 +09:00
parent a0ffeb236e
commit afef6dfa80
2 changed files with 8 additions and 10 deletions

View File

@@ -1,13 +1,13 @@
package com.bio.bio_backend.domain.base.member.service;
import java.util.List;
import java.util.Map;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import com.bio.bio_backend.domain.base.member.dto.MemberDto;
import java.util.List;
import java.util.Map;
public interface MemberService extends UserDetailsService {
UserDetails loadUserByUsername(String id);
@@ -16,9 +16,9 @@ public interface MemberService extends UserDetailsService {
String getRefreshToken(String id);
int deleteRefreshToken(String id);
void deleteRefreshToken(String id);
void updateMember(MemberDto member);
List<MemberDto> selectMemberList(Map<String, String> params);
int updateMember(MemberDto member);
}

View File

@@ -63,13 +63,12 @@ public class MemberServiceImpl implements MemberService {
@Override
@Transactional
public int updateMember(MemberDto memberDto) {
public void updateMember(MemberDto memberDto) {
Member member = memberRepository.findActiveMemberByUserId(memberDto.getUserId())
.orElseThrow(() -> new ApiException(ApiResponseCode.USER_NOT_FOUND));
memberMapper.updateMemberFromDto(memberDto, member);
memberRepository.save(member);
return 1;
}
@Override
@@ -82,13 +81,12 @@ public class MemberServiceImpl implements MemberService {
@Override
@Transactional
public int deleteRefreshToken(String id) {
public void deleteRefreshToken(String id) {
Member member = memberRepository.findActiveMemberByUserId(id)
.orElseThrow(() -> new ApiException(ApiResponseCode.USER_NOT_FOUND));
member.setRefreshToken(null);
memberRepository.save(member);
return 1;
}
@Override