From 1da3aa3c5581fc27b2fdcdd968c9c8e5afe0307c Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 9 Jan 2023 23:10:38 +0100 Subject: [PATCH] WIP --- .../mongodb/{ChatRoomDao.java => ChatRoomTo.java} | 10 +++++----- .../mongodb/{MessageDao.java => MessageTo.java} | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) rename src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/{ChatRoomDao.java => ChatRoomTo.java} (75%) rename src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/{MessageDao.java => MessageTo.java} (90%) diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomDao.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomTo.java similarity index 75% rename from src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomDao.java rename to src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomTo.java index b83966e5..da33a5bf 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomDao.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomTo.java @@ -13,21 +13,21 @@ import java.util.UUID; @Setter(AccessLevel.PACKAGE) @EqualsAndHashCode(of = { "id" }) @ToString(of = { "id", "name" }) -public class ChatRoomDao +public class ChatRoomTo { private UUID id; private String name; - private List messages; + private List messages; - public static ChatRoomDao from(ChatRoom chatroom) + public static ChatRoomTo from(ChatRoom chatroom) { - return new ChatRoomDao( + return new ChatRoomTo( chatroom.getId(), chatroom.getName(), chatroom .getMessages() - .map(MessageDao::from) + .map(MessageTo::from) .collectList() .block()); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MessageDao.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MessageTo.java similarity index 90% rename from src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MessageDao.java rename to src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MessageTo.java index 472b21fa..7af18457 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MessageDao.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MessageTo.java @@ -12,7 +12,7 @@ import java.time.LocalDateTime; @Setter(AccessLevel.PACKAGE) @EqualsAndHashCode(of = { "user", "id" }) @ToString(of = { "user", "id" }) -class MessageDao +class MessageTo { private Long id; private Long serial; @@ -25,10 +25,10 @@ class MessageDao return new Message(Message.MessageKey.of(user, id), serial, time, text); } - static MessageDao from(Message message) + static MessageTo from(Message message) { return - new MessageDao( + new MessageTo( message.getId(), message.getSerialNumber(), message.getTimestamp(), -- 2.20.1