|
| 1 | +package com.mengxiang.im.push.bean.card; |
| 2 | + |
| 3 | +import com.google.gson.annotations.Expose; |
| 4 | +import com.mengxiang.im.push.bean.db.Message; |
| 5 | + |
| 6 | +import java.time.LocalDateTime; |
| 7 | + |
| 8 | +/** |
| 9 | + * 消息的卡片Model |
| 10 | + */ |
| 11 | +public class MessageCard { |
| 12 | + @Expose |
| 13 | + private String id; // Id |
| 14 | + @Expose |
| 15 | + private String content;// 内容 |
| 16 | + @Expose |
| 17 | + private String attach;// 附件,附属信息 |
| 18 | + @Expose |
| 19 | + private int type;// 消息类型 |
| 20 | + @Expose |
| 21 | + private LocalDateTime createAt;// 创建时间 |
| 22 | + @Expose |
| 23 | + private String groupId;// 如果是群信息,对应群Id |
| 24 | + @Expose |
| 25 | + private String senderId;// 发送者Id,不为空 |
| 26 | + @Expose |
| 27 | + private String receiverId;// 接收者Id |
| 28 | + |
| 29 | + public MessageCard(Message message) { |
| 30 | + this.id = message.getId(); |
| 31 | + this.content = message.getContent(); |
| 32 | + this.type = message.getType(); |
| 33 | + this.attach = message.getAttach(); |
| 34 | + this.createAt = message.getCreateAt(); |
| 35 | + this.groupId = message.getGroupId(); |
| 36 | + this.senderId = message.getSenderId(); |
| 37 | + this.receiverId = message.getReceiverId(); |
| 38 | + } |
| 39 | + |
| 40 | + public String getId() { |
| 41 | + return id; |
| 42 | + } |
| 43 | + |
| 44 | + public void setId(String id) { |
| 45 | + this.id = id; |
| 46 | + } |
| 47 | + |
| 48 | + public String getContent() { |
| 49 | + return content; |
| 50 | + } |
| 51 | + |
| 52 | + public void setContent(String content) { |
| 53 | + this.content = content; |
| 54 | + } |
| 55 | + |
| 56 | + public String getAttach() { |
| 57 | + return attach; |
| 58 | + } |
| 59 | + |
| 60 | + public void setAttach(String attach) { |
| 61 | + this.attach = attach; |
| 62 | + } |
| 63 | + |
| 64 | + public int getType() { |
| 65 | + return type; |
| 66 | + } |
| 67 | + |
| 68 | + public void setType(int type) { |
| 69 | + this.type = type; |
| 70 | + } |
| 71 | + |
| 72 | + public LocalDateTime getCreateAt() { |
| 73 | + return createAt; |
| 74 | + } |
| 75 | + |
| 76 | + public void setCreateAt(LocalDateTime createAt) { |
| 77 | + this.createAt = createAt; |
| 78 | + } |
| 79 | + |
| 80 | + public String getGroupId() { |
| 81 | + return groupId; |
| 82 | + } |
| 83 | + |
| 84 | + public void setGroupId(String groupId) { |
| 85 | + this.groupId = groupId; |
| 86 | + } |
| 87 | + |
| 88 | + public String getSenderId() { |
| 89 | + return senderId; |
| 90 | + } |
| 91 | + |
| 92 | + public void setSenderId(String senderId) { |
| 93 | + this.senderId = senderId; |
| 94 | + } |
| 95 | + |
| 96 | + public String getReceiverId() { |
| 97 | + return receiverId; |
| 98 | + } |
| 99 | + |
| 100 | + public void setReceiverId(String receiverId) { |
| 101 | + this.receiverId = receiverId; |
| 102 | + } |
| 103 | +} |
0 commit comments