diff --git a/src/main/java/aromanticcat/umcproject/service/MemberService.java b/src/main/java/aromanticcat/umcproject/service/MemberService.java index 273f167..fa8b901 100644 --- a/src/main/java/aromanticcat/umcproject/service/MemberService.java +++ b/src/main/java/aromanticcat/umcproject/service/MemberService.java @@ -16,6 +16,6 @@ public interface MemberService { SecurityUserDto getUserInfo(); - Member changeNickName(String nickname); + Member updateNickname(String nickname); } diff --git a/src/main/java/aromanticcat/umcproject/service/MemberServiceImpl.java b/src/main/java/aromanticcat/umcproject/service/MemberServiceImpl.java index 77827ca..a5da970 100644 --- a/src/main/java/aromanticcat/umcproject/service/MemberServiceImpl.java +++ b/src/main/java/aromanticcat/umcproject/service/MemberServiceImpl.java @@ -63,7 +63,7 @@ public SecurityUserDto getUserInfo() { @Override - public Member changeNickName(String newNickname) { + public Member updateNickname(String newNickname) { // 닉네임 입력 체크 isNicknameExist(newNickname); // 닉네임 중복 체크 diff --git a/src/main/java/aromanticcat/umcproject/web/controller/MemberController.java b/src/main/java/aromanticcat/umcproject/web/controller/MemberController.java index f798b52..6a71b77 100644 --- a/src/main/java/aromanticcat/umcproject/web/controller/MemberController.java +++ b/src/main/java/aromanticcat/umcproject/web/controller/MemberController.java @@ -6,7 +6,7 @@ import aromanticcat.umcproject.service.MemberService; import aromanticcat.umcproject.web.dto.MemberResponseDTO; import io.swagger.v3.oas.annotations.Operation; -import org.springframework.beans.factory.annotation.Autowired; +import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -14,9 +14,10 @@ import org.springframework.web.bind.annotation.RestController; @RestController +@RequiredArgsConstructor public class MemberController { - @Autowired - private MemberService service; + + private final MemberService service; @PostMapping("/signUp") @Operation(summary = "회원가입 API", description = "회원가입 API입니다.") @@ -31,11 +32,11 @@ public ApiResponse signup(@RequestBody St } } - @PostMapping("/mypage/changeNickname") + @PostMapping("/mypage/nickname") @Operation(summary = "닉네임 변경 API", description = "닉네임 변경 API입니다.") - public ApiResponse changeNickName(@RequestBody String nickname) { + public ApiResponse updateNickname(@RequestBody String nickname) { try { - Member user = service.changeNickName(nickname); + Member user = service.updateNickname(nickname); return ApiResponse.onSuccess(MemberConverter.toMemberDTO(user)); } catch (Exception e) {