2026-06-30 24681c81c09022f584a57006f2534b5f74723414
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
68
package cn.iocoder.yudao.module.im.service.websocket.notification.message;
 
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.dal.dataobject.message.ImPrivateMessageDO;
import lombok.Data;
import lombok.experimental.Accessors;
 
import java.time.LocalDateTime;
 
/**
 * IM 私聊消息 WebSocket 统一推送通知
 *
 * @author 芋道源码
 */
@Data
@Accessors(chain = true)
public class ImPrivateMessageNotification {
 
    /**
     * 消息编号
     */
    private Long id;
    /**
     * 客户端消息编号
     */
    private String clientMessageId;
    /**
     * 发送人编号
     */
    private Long senderId;
    /**
     * 接收人编号
     */
    private Long receiverId;
    /**
     * 消息类型
     */
    private Integer type;
    /**
     * 消息内容
     */
    private String content;
    /**
     * 消息状态
     */
    private Integer status;
    /**
     * 回执状态
     */
    private Integer receiptStatus;
    /**
     * 发送时间
     */
    private LocalDateTime sendTime;
 
    // ========== 静态工厂方法 ==========
 
    /**
     * 构建发送消息通知
     *
     * @param message 私聊消息 DO
     * @return 私聊通知
     */
    public static ImPrivateMessageNotification ofSend(ImPrivateMessageDO message) {
        return BeanUtils.toBean(message, ImPrivateMessageNotification.class);
    }
 
}