wangmengmeng
2024-12-24 24432a361d5c6bd6f3d8c008693e9f1155d62517
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
package com.dji.sample.component.websocket.service;
 
import com.dji.sample.component.websocket.config.MyConcurrentWebSocketSession;
import com.dji.sdk.websocket.WebSocketMessageResponse;
 
import java.util.Collection;
 
/**
 * @author sean.zhou
 * @date 2021/11/24
 * @version 0.1
 */
public interface IWebSocketMessageService {
 
    /**
     * Send a message to the specific connection.
     * @param session   A WebSocket connection object
     * @param message   message
     */
    void sendMessage(MyConcurrentWebSocketSession session, WebSocketMessageResponse message);
 
    /**
     * Send the same message to specific connection.
     * @param sessions  A collection of WebSocket connection objects.
     * @param message   message
     */
    void sendBatch(Collection<MyConcurrentWebSocketSession> sessions, WebSocketMessageResponse message);
 
    void sendBatch(String workspaceId, Integer userType, String bizCode, Object data);
 
    void sendBatch(String workspaceId, String bizCode, Object data);
}