diff --git a/src/main/java/com/leets/xcellentbe/domain/user/dto/UserProfileResponseDto.java b/src/main/java/com/leets/xcellentbe/domain/user/dto/UserProfileResponseDto.java index 4f82915..45d5b8f 100644 --- a/src/main/java/com/leets/xcellentbe/domain/user/dto/UserProfileResponseDto.java +++ b/src/main/java/com/leets/xcellentbe/domain/user/dto/UserProfileResponseDto.java @@ -26,16 +26,16 @@ public class UserProfileResponseDto { private int followingsCount; @JsonProperty("isFollowing") - private boolean isFollowing; + private Boolean isFollowing; @JsonProperty("isMyProfile") - private boolean isMyProfile; + private Boolean isMyProfile; @Builder private UserProfileResponseDto(String email, String customId, String userName, String profileImageUrl, String backgroundProfileImageUrl, String phoneNumber, String description, String websiteUrl, String location, int userBirthYear, int userBirthMonth, int userBirthDay, int followersCount, int followingsCount, - boolean isFollowing, boolean isMyProfile) { + Boolean isFollowing, Boolean isMyProfile) { this.email = email; this.customId = customId; this.userName = userName; @@ -54,8 +54,8 @@ private UserProfileResponseDto(String email, String customId, String userName, S this.isFollowing = isFollowing; } - public static UserProfileResponseDto from(User user, int followersCount, int followingsCount, boolean isFollowing, - boolean isMyProfile) { + public static UserProfileResponseDto from(User user, int followersCount, int followingsCount, Boolean isFollowing, + Boolean isMyProfile) { return UserProfileResponseDto.builder() .email(user.getEmail()) .customId(user.getCustomId()) diff --git a/src/main/java/com/leets/xcellentbe/domain/user/service/UserService.java b/src/main/java/com/leets/xcellentbe/domain/user/service/UserService.java index 8c77fd7..a1e495b 100644 --- a/src/main/java/com/leets/xcellentbe/domain/user/service/UserService.java +++ b/src/main/java/com/leets/xcellentbe/domain/user/service/UserService.java @@ -57,7 +57,7 @@ public UserProfileResponseDto getProfile(HttpServletRequest request) { int followerCount = followRepository.countByFollowing(user); int followingCount = followRepository.countByFollower(user); - + return UserProfileResponseDto.from(user, followerCount, followingCount, false, true); } @@ -66,8 +66,8 @@ public UserProfileResponseDto getProfileWithoutToken(String customId, HttpServle User myinfo = getUser(request); User user = userRepository.findByCustomId(customId).orElseThrow(UserNotFoundException::new); - boolean isMyProfile = myinfo.equals(user); - boolean isFollowing = followRepository.findByFollowerAndFollowing(myinfo, user).isPresent(); + Boolean isMyProfile = myinfo.equals(user); + Boolean isFollowing = followRepository.findByFollowerAndFollowing(myinfo, user).isPresent(); int followerCount = followRepository.countByFollowing(user); int followingCount = followRepository.countByFollower(user);