-
Notifications
You must be signed in to change notification settings - Fork 0
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
Hotfix/#117: lastUpdate 반환값 및 시간대 기준 위치 수정 #118
The head ref may contain hidden characters: "hotfix/#117/\uCC44\uD305\uBC29-\uBAA9\uB85D-\uC870\uD68C-\uC2DC\uAC04-\uBC84\uADF8-\uC218\uC815"
Conversation
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.
현재 BaseEntity를 상속받는 엔티티들은 EntityManager.persist() 시에 BaseEntity의 onCreate() 메서드에 의해 '생성일, 수정일, 상태' 정보가 초기화되는 로직인데,
작성해주신 코드처럼 수정이 필요한 건가요??
저도 생성일 response에 담아 보내는 부분의 코드를 LocalDateTime 형식으로 변경 & 시간대 변경 하여 push 했습니다! |
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.
코멘트 확인 부탁드립니다!
@@ -119,7 +119,7 @@ public ReadChatRoomMemberResponse readChatRoomMembers(Long spaceId, Long chatRoo | |||
UserSpace userSpace = userSpaceDao.findUserSpaceByUserAndSpace(user, spaceById) | |||
.orElseThrow(() -> new CustomException(USER_IS_NOT_IN_SPACE)); | |||
|
|||
userList.add(new UserInfoInSpace(user.getUserId(), user.getUserName(), userSpace.getUserProfileImg(), user.getSignupType())); | |||
userList.add(new UserInfoInSpace(user.getUserId(), user.getUserName(), userSpace.getUserProfileImg(), userSpace.getUserSpaceAuth())); | |||
}); |
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.
Good!
List<ChatRoom> activeChatRooms = chatRoomList.stream() | ||
.filter(userChatRoom -> "ACTIVE".equals(userChatRoom.getStatus())) | ||
.toList(); | ||
|
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.
ACTIVE 만 조회하는 로직 좋습니다
chatRoomByChatRoomId.updateInactive(); | ||
|
||
// TODO 3: DB에 변경 사항 저장 | ||
chatRoomDao.save(chatRoomByChatRoomId); | ||
|
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.
엔티티의 필드값을 update 한 후, 다시 dao단에서 persist를 하지않아도 jpa가 자동으로 db에 변경사항을 반영해 주는 것으로 알고 있습니다!
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.
저도 그렇게 알고 있었는데 기존대로 save 없이는 db에 반영이 되지 않더라구요..
정확한 이유는 모르겠으나 일단 구현을 위해 추가했습니다
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.
엇 일단 확인했습니다
@@ -177,8 +191,12 @@ public ChatSuccessResponse deleteChatRoom(Long chatRoomId) { | |||
ChatRoom chatRoomByChatRoomId = chatRoomDao.findById(chatRoomId) | |||
.orElseThrow(() -> new CustomException(CHATROOM_NOT_EXIST)); | |||
|
|||
// TODO 2: 해당 chatRoom inactive로 변경 | |||
chatRoomByChatRoomId.updateInactive(); | |||
|
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.
오호 이 status update 메서드는 유용하게 쓰일거 같네요!
Hotfix/#117: lastUpdate 반환값 및 시간대 기준 위치 수정
📝 요약
🔖 변경 사항
이슈에 기재한 설명 참고 부탁드립니다
✅ 리뷰 요구사항
LocalDateTime 처리하는 부분에서 기준을 seoul로 맞추는 걸 누락한 부분이 있더라구요
다른 분들도 담당 도메인에서 한 번 체크해주시면 좋을 것 같습니다
📸 확인 방법 (선택)
📌 PR 진행 시 이러한 점들을 참고해 주세요