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..d81d612 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 @@ -1,6 +1,5 @@ package com.leets.xcellentbe.domain.user.dto; -import com.fasterxml.jackson.annotation.JsonProperty; import com.leets.xcellentbe.domain.user.domain.User; import lombok.Builder; @@ -24,18 +23,14 @@ public class UserProfileResponseDto { private int userBirthDay; private int followersCount; private int followingsCount; - - @JsonProperty("isFollowing") - private boolean isFollowing; - - @JsonProperty("isMyProfile") - private boolean isMyProfile; + private Boolean isFollowing; + 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 +49,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);