diff --git a/src/main/java/coffeemeet/server/chatting/history/presentation/dto/ChattingMessageHistoriesHTTP.java b/src/main/java/coffeemeet/server/chatting/history/presentation/dto/ChattingMessageHistoriesHTTP.java index c0c86314..a94fc10e 100644 --- a/src/main/java/coffeemeet/server/chatting/history/presentation/dto/ChattingMessageHistoriesHTTP.java +++ b/src/main/java/coffeemeet/server/chatting/history/presentation/dto/ChattingMessageHistoriesHTTP.java @@ -2,7 +2,7 @@ import static lombok.AccessLevel.PRIVATE; -import coffeemeet.server.chatting.history.service.dto.ChattingMessageHistory; +import coffeemeet.server.chatting.history.service.dto.ChattingHistory; import coffeemeet.server.chatting.history.service.dto.ChattingMessageHistoryListDto; import java.util.List; import lombok.NoArgsConstructor; @@ -11,7 +11,7 @@ public final class ChattingMessageHistoriesHTTP { public record Response( - List chatHistories, + List chatHistories, boolean hasNext) { public static Response from(ChattingMessageHistoryListDto chattingMessageHistoryListDto) { diff --git a/src/main/java/coffeemeet/server/chatting/history/service/ChattingRoomHistoryService.java b/src/main/java/coffeemeet/server/chatting/history/service/ChattingRoomHistoryService.java index 82143a27..9e52eccf 100644 --- a/src/main/java/coffeemeet/server/chatting/history/service/ChattingRoomHistoryService.java +++ b/src/main/java/coffeemeet/server/chatting/history/service/ChattingRoomHistoryService.java @@ -1,11 +1,12 @@ package coffeemeet.server.chatting.history.service; +import coffeemeet.server.chatting.history.domain.ChattingMessageHistory; import coffeemeet.server.chatting.history.domain.ChattingRoomHistory; import coffeemeet.server.chatting.history.domain.UserChattingHistory; import coffeemeet.server.chatting.history.implement.ChattingMessageHistoryQuery; import coffeemeet.server.chatting.history.implement.ChattingRoomHistoryQuery; import coffeemeet.server.chatting.history.implement.UserChattingHistoryQuery; -import coffeemeet.server.chatting.history.service.dto.ChattingMessageHistory; +import coffeemeet.server.chatting.history.service.dto.ChattingHistory; import coffeemeet.server.chatting.history.service.dto.ChattingMessageHistoryListDto; import coffeemeet.server.chatting.history.service.dto.ChattingRoomHistoryDto; import coffeemeet.server.user.domain.User; @@ -48,13 +49,13 @@ public ChattingMessageHistoryListDto searchChattingMessageHistories(Long roomHis Long firstMessageId, int pageSize) { ChattingRoomHistory chattingRoomHistory = chattingRoomHistoryQuery.getChattingRoomHistoryBy( roomHistoryId); - List messageHistories = chattingMessageHistoryQuery.getMessageHistories( + List messageHistories = chattingMessageHistoryQuery.getMessageHistories( chattingRoomHistory, firstMessageId, pageSize); boolean hasNext = messageHistories.size() >= pageSize; - List historyDtoList = messageHistories + List historyDtoList = messageHistories .stream() - .map(chattingMessageHistory -> ChattingMessageHistory.of( + .map(chattingMessageHistory -> ChattingHistory.of( chattingMessageHistory.getUser(), chattingMessageHistory)) .toList(); return ChattingMessageHistoryListDto.of(historyDtoList, hasNext); diff --git a/src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingMessageHistory.java b/src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingHistory.java similarity index 84% rename from src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingMessageHistory.java rename to src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingHistory.java index 8bde6208..7157cf6c 100644 --- a/src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingMessageHistory.java +++ b/src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingHistory.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import java.time.LocalDateTime; -public record ChattingMessageHistory( +public record ChattingHistory( Long userId, Long messageId, String nickname, @@ -14,9 +14,9 @@ public record ChattingMessageHistory( LocalDateTime createdAt ) { - public static ChattingMessageHistory of(User user, + public static ChattingHistory of(User user, coffeemeet.server.chatting.history.domain.ChattingMessageHistory chattingMessageHistory) { - return new ChattingMessageHistory( + return new ChattingHistory( user.getId(), chattingMessageHistory.getId(), user.getProfile().getNickname(), diff --git a/src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingMessageHistoryListDto.java b/src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingMessageHistoryListDto.java index 95448b03..2270a8da 100644 --- a/src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingMessageHistoryListDto.java +++ b/src/main/java/coffeemeet/server/chatting/history/service/dto/ChattingMessageHistoryListDto.java @@ -3,11 +3,11 @@ import java.util.List; public record ChattingMessageHistoryListDto( - List contents, + List contents, boolean hasNext ) { - public static ChattingMessageHistoryListDto of(List contents, + public static ChattingMessageHistoryListDto of(List contents, boolean hasNext) { return new ChattingMessageHistoryListDto(contents, hasNext); }