Skip to content

Commit

Permalink
KL-166/chore: rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhamma committed Sep 9, 2024
1 parent fec7e2f commit 97aaa54
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "내 정보를 수정합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}
Expand Down

0 comments on commit 97aaa54

Please sign in to comment.