diff --git a/src/main/java/taco/klkl/domain/user/controller/UserController.java b/src/main/java/taco/klkl/domain/user/controller/UserController.java index 9946f522..961427da 100644 --- a/src/main/java/taco/klkl/domain/user/controller/UserController.java +++ b/src/main/java/taco/klkl/domain/user/controller/UserController.java @@ -94,9 +94,9 @@ public UserFollowResponse followUser(@Valid @RequestBody final UserFollowRequest } @Operation(summary = "유저 팔로우 취소", description = "유저 팔로우를 취소합니다.") - @DeleteMapping("/following/{targetUserId}") - public UserFollowResponse cancelUserFollow(@PathVariable final Long targetUserId) { - return userService.removeUserFollow(targetUserId); + @DeleteMapping("/following/{userId}") + public UserFollowResponse cancelUserFollow(@PathVariable final Long userId) { + return userService.removeUserFollow(userId); } @Operation(summary = "내 정보 수정", description = "내 정보를 수정합니다.") diff --git a/src/main/java/taco/klkl/domain/user/dto/request/UserFollowRequest.java b/src/main/java/taco/klkl/domain/user/dto/request/UserFollowRequest.java index c87eb47d..5487726f 100644 --- a/src/main/java/taco/klkl/domain/user/dto/request/UserFollowRequest.java +++ b/src/main/java/taco/klkl/domain/user/dto/request/UserFollowRequest.java @@ -4,7 +4,7 @@ import taco.klkl.global.common.constants.UserValidationMessages; public record UserFollowRequest( - @NotNull(message = UserValidationMessages.TARGET_USER_ID_NOT_NULL) - Long targetUserId + @NotNull(message = UserValidationMessages.USER_ID_NOT_NULL) + Long userId ) { } diff --git a/src/main/java/taco/klkl/domain/user/service/UserServiceImpl.java b/src/main/java/taco/klkl/domain/user/service/UserServiceImpl.java index fa782a80..bf007459 100644 --- a/src/main/java/taco/klkl/domain/user/service/UserServiceImpl.java +++ b/src/main/java/taco/klkl/domain/user/service/UserServiceImpl.java @@ -96,7 +96,7 @@ public User createUser(final UserCreateRequest createRequest) { @Transactional public UserFollowResponse createUserFollow(final UserFollowRequest followRequest) { final User follower = userUtil.getCurrentUser(); - final User following = userRepository.findById(followRequest.targetUserId()) + final User following = userRepository.findById(followRequest.userId()) .orElseThrow(UserNotFoundException::new); if (isFollowPresent(follower, following)) { return UserFollowResponse.of(true, follower, following); diff --git a/src/main/java/taco/klkl/global/common/constants/UserValidationMessages.java b/src/main/java/taco/klkl/global/common/constants/UserValidationMessages.java index 6dd75e9c..943015a2 100644 --- a/src/main/java/taco/klkl/global/common/constants/UserValidationMessages.java +++ b/src/main/java/taco/klkl/global/common/constants/UserValidationMessages.java @@ -3,7 +3,7 @@ public final class UserValidationMessages { public static final String NAME_NOT_BLANK = "이름은 비워둘 수 없습니다."; - public static final String TARGET_USER_ID_NOT_NULL = "대상 유저 ID는 필수 항목입니다."; + public static final String USER_ID_NOT_NULL = "유저 ID는 필수 항목입니다."; private UserValidationMessages() { }