MessageHistoryVO.java
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package cn.fw.hestia.domain.vo;
import cn.fw.hestia.domain.db.MessageHistory;
import lombok.Data;
import lombok.ToString;
import java.util.Date;
import java.util.Objects;
/**
* @author : kurisu
* @className : Demo
* @description :
* @date: 2021-09-23 15:26
*/
@Data
@ToString
public class MessageHistoryVO {
private Long messageId;
/**
* 会员id
*/
private Long memberId;
/**
* 消息标题
*/
private String title;
/**
* 消息内容
*/
private String content;
/**
* 备注
*/
private String remark;
/**
* 小程序页面路径
*/
private String pagePath;
/**
* 是否已读
*/
private Boolean readz;
/**
* 发送时间
*/
private Date messageTime;
public static MessageHistoryVO with(MessageHistory history) {
if (Objects.isNull(history)) {
return null;
}
MessageHistoryVO vo = new MessageHistoryVO();
vo.setMessageId(history.getId());
vo.setMemberId(history.getMemberId());
vo.setTitle(history.getTitle());
vo.setContent(history.getContent());
vo.setReadz(history.getReadz());
vo.setRemark(history.getRemark());
vo.setMessageTime(history.getCreateTime());
if (history.getPagePath() != null && history.getPagePath().trim().length() > 0) {
String st = history.getPagePath() + "?sceneToken=" + history.getId();
vo.setPagePath(st);
}
return vo;
}
}