Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ public static UserResponseDTO.ProfileDto toProfileIconDto(User user){
.userId(user.getId())
.profileImageUrl(user.getProfileImageUrl())
.nameId(user.getNameId())
.nickname(user.getNickname())
.introduce(user.getIntroduce())
Comment on lines +63 to +64

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

좋은 수정입니다. nicknameintroduce를 추가하여 null 문제를 해결하셨네요.

다만, 바로 아래 toProfileDto 메서드와 기능이 거의 중복되며, 이번 수정으로 인해 두 메서드가 반환하는 ProfileDto 객체의 내용에 불일치가 발생했습니다. (toProfileIconDtointroduce를 포함하지만 toProfileDto는 포함하지 않음).

// todo 주석에서도 언급되었듯이 두 메서드를 통합하는 리팩토링을 진행하는 것이 좋아 보입니다. 예를 들어, toProfileDtointroduce 필드도 설정하도록 수정하고, toProfileIconDtotoProfileDto(user, true)를 호출하도록 변경하면 코드 중복을 줄이고 일관성을 유지할 수 있습니다.

이번 PR에서 함께 수정하는 것을 고려해 주세요.

.isFollowing(true)
.build();
}

// todo: 두개 비슷함 -> 합치기
public static UserResponseDTO.ProfileDto toProfileDto(User user, Boolean isFollowing){
return UserResponseDTO.ProfileDto.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static class ProfileDto {
private Long userId;
@NotNull
private String profileImageUrl;

@NotNull
private String nameId;
@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public UserInfoDTO getUserInfo(HttpServletRequest request) {

// 팔로잉한 유저의 프로필 아이콘 목록 조회
@Override
public UserResponseDTO.UserIconListResponseDto followingUserIconList(HttpServletRequest request,int page, int size) {
public UserResponseDTO.UserIconListResponseDto followingUserIconList(HttpServletRequest request, int page, int size) {
User user = getLoginUser(request);
Page<UserFollow> followingPage = userFollowRepository.findByUser(user, PageRequest.of(page, size));

Expand Down
Loading