2025-11-27 19:07:55 +08:00

24 lines
675 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.czlis.interfaceCommon.websocket;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 客户端与服务端的统一消息协议
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WebSocketMessage {
// 消息类型(如CHAT/NOTICE/ORDER/HEARTBEAT)
private String msgType;
// 业务数据(JSON字符串,可解析为对应业务DTO)
private String data;
// 发送者ID(可选,也可从WebSocket连接中获取)
private String senderId;
// 接收者ID(可选,单聊/广播区分)
private String receiverId;
// 消息时间戳
private Long timestamp;
}