projects
/
demos
/
kafka
/
chat
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WIP:TMP:test -- FIX: `ChatRoomData` active/inactive
[demos/kafka/chat]
/
src
/
main
/
java
/
de
/
juplo
/
kafka
/
chat
/
backend
/
api
/
MessageTo.java
diff --git
a/src/main/java/de/juplo/kafka/chat/backend/api/MessageTo.java
b/src/main/java/de/juplo/kafka/chat/backend/api/MessageTo.java
index
c771386
..
eb50882
100644
(file)
--- a/
src/main/java/de/juplo/kafka/chat/backend/api/MessageTo.java
+++ b/
src/main/java/de/juplo/kafka/chat/backend/api/MessageTo.java
@@
-1,22
+1,29
@@
-package de.juplo.kafka.chat
room
.api;
+package de.juplo.kafka.chat
.backend
.api;
-import de.juplo.kafka.chat
room
.domain.Message;
+import de.juplo.kafka.chat
.backend
.domain.Message;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.Data;
+import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
@Data
import java.time.LocalDateTime;
@Data
+@NoArgsConstructor
@AllArgsConstructor
public class MessageTo
{
private Long id;
@AllArgsConstructor
public class MessageTo
{
private Long id;
- private Long serial
Number
;
- private LocalDateTime time
stamp
;
+ private Long serial;
+ private LocalDateTime time;
private String user;
private String text;
private String user;
private String text;
+ public Message toMessage()
+ {
+ return new Message(Message.MessageKey.of(user, id), serial, time, text);
+ }
+
public static MessageTo from(Message message)
{
return
public static MessageTo from(Message message)
{
return
@@
-24,7
+31,7
@@
public class MessageTo
message.getId(),
message.getSerialNumber(),
message.getTimestamp(),
message.getId(),
message.getSerialNumber(),
message.getTimestamp(),
- message.getUser(),
- message.getText());
+ message.getUser
name
(),
+ message.get
Message
Text());
}
}
}
}