Skip to content

Commit

Permalink
fix: 채팅 목록 조회 정합성 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Curry4182 committed Apr 17, 2024
1 parent 3bfdb96 commit c938a07
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Service;

import com.programmers.lime.common.cursor.CursorPageParameters;
Expand Down Expand Up @@ -195,13 +194,15 @@ private LocalDateTime getCreatedAt(final String timeSeq) {
}

private ChatSummary getChatSummary(final ChatCursorCache data) {
Member member = memberReader.read(data.memberId());

return new ChatSummary(
data.cursorId(),
data.chatId(),
data.chatRoomId(),
data.memberId(),
data.nickname(),
data.profileImage(),
member.getNickname(),
member.getProfileImage(),
data.message(),
LocalDateTime.parse(data.sendAt()),
ChatType.valueOf(data.chatType())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ private ChatCursorCache getChatSummaryCacheData(
.chatId(chatSummary.chatId())
.chatRoomId(chatSummary.chatRoomId())
.memberId(chatSummary.memberId())
.nickname(chatSummary.nickname())
.profileImage(chatSummary.profileImage())
.message(chatSummary.message())
.sendAt(chatSummary.sendAt().toString())
.chatType(chatSummary.chatType().name())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ public ChatCursorCache chatCursorCache(
.chatId(chatInfoWithMember.chatId())
.chatRoomId(chatInfoWithMember.chatRoomId())
.memberId(chatInfoWithMember.memberId())
.nickname(chatInfoWithMember.nickname())
.profileImage(chatInfoWithMember.profileImage())
.message(chatInfoWithMember.message())
.sendAt(chatInfoWithMember.sendAt().toString())
.chatType(chatInfoWithMember.chatType().name())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ public record ChatCursorCache(
Long chatId,
Long chatRoomId,
Long memberId,
String nickname,
String profileImage,
String message,
String sendAt,
String chatType
Expand All @@ -28,8 +26,6 @@ public static ChatCursorCache newNextCursorId(
.chatId(chatCursorCache.chatId())
.chatRoomId(chatCursorCache.chatRoomId())
.memberId(chatCursorCache.memberId())
.nickname(chatCursorCache.nickname())
.profileImage(chatCursorCache.profileImage())
.message(chatCursorCache.message())
.sendAt(chatCursorCache.sendAt())
.chatType(chatCursorCache.chatType())
Expand Down

0 comments on commit c938a07

Please sign in to comment.