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
package cn.iocoder.yudao.module.im.service.websocket.notification.message;
 
import lombok.Data;
import lombok.experimental.Accessors;
 
/**
 * IM 消息已读同步通知
 *
 * @author 芋道源码
 */
@Data
@Accessors(chain = true)
public class ImMessageReadNotification {
 
    /**
     * 已读位置(最大已读消息编号)
     */
    private Long id;
    /**
     * 发送人编号
     */
    private Long senderId;
    /**
     * 私聊接收人编号
     */
    private Long receiverId;
    /**
     * 群编号
     */
    private Long groupId;
    /**
     * 频道编号
     */
    private Long channelId;
    /**
     * 已读位置(最大已读消息编号)
     */
    private Long readId;
 
    public static ImMessageReadNotification ofPrivate(Long senderId, Long receiverId, Long readId) {
        return new ImMessageReadNotification()
                .setId(readId).setReadId(readId)
                .setSenderId(senderId).setReceiverId(receiverId);
    }
 
    public static ImMessageReadNotification ofGroup(Long senderId, Long groupId, Long readId) {
        return new ImMessageReadNotification()
                .setId(readId).setReadId(readId)
                .setSenderId(senderId).setGroupId(groupId);
    }
 
    public static ImMessageReadNotification ofChannel(Long channelId, Long readId) {
        return new ImMessageReadNotification()
                .setId(readId).setReadId(readId)
                .setChannelId(channelId);
    }
 
}