-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/회원탈퇴 #261 #263
The head ref may contain hidden characters: "feat/\uD68C\uC6D0\uD0C8\uD1F4-#261"
Feat/회원탈퇴 #261 #263
Changes from 4 commits
86191ea
7a8cce9
e67851f
9d5160a
cfc73f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ | |
import kr.co.wingle.message.mapper.MessageMapper; | ||
import kr.co.wingle.message.repository.MessageRepository; | ||
import kr.co.wingle.profile.ProfileService; | ||
import kr.co.wingle.profile.dto.ProfileGetResponseDto; | ||
import kr.co.wingle.writing.WritingService; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
|
@@ -56,8 +55,6 @@ public MessageResponseWithRecipentDto getListByRoom(Long roomId, int page, int s | |
Pageable pageable = PageRequest.of(page, size); | ||
List<Message> pages = messageRepository.findByRoomIdAndIsDeletedOrderByCreatedTimeDesc(roomId, false, pageable); | ||
|
||
ProfileGetResponseDto profile = profileService.getProfile(recipient.getMemberId()); | ||
|
||
if (pages.isEmpty()) { | ||
return MessageResponseWithRecipentDto.of(); | ||
} | ||
|
@@ -68,8 +65,8 @@ public MessageResponseWithRecipentDto getListByRoom(Long roomId, int page, int s | |
|
||
return MessageResponseWithRecipentDto.of( | ||
AES256Util.encrypt(recipient.getMemberId().toString()), | ||
profile.getImage(), | ||
recipient.getSchoolName(), | ||
recipient.isDeleted() ? null : profileService.getProfile(recipient.getMemberId()).getImage(), | ||
recipient.isDeleted() ? "(알수없음)" : recipient.getSchoolName(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 반영해도 좋고 안 해도 좋습니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @LeeJE20 상수화하고 싶었는데 어느 위치에 만들어 놓아야 할지 애매해서 일단 literal string으로 썼습니다,,🥲 |
||
messages | ||
); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
가급적 반영해 주세요!
클린코드에서 값이 없을때 null을 보내는 것보다는 "", 빈 배열, 빈 리스트 등의 빈 값을 보내는 것을 더 지향합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LeeJE20 반영했습니다!
null 대신 "", 빈 배열, 빈 리스트 등을 사용하는 이유는 NullPointerException이 발생할 가능성이 있기 때문인가요?!