| package com.matrix.component.websoket; | 
|   | 
| import net.sf.json.JSONObject; | 
|   | 
| /** | 
|  * websoket通用消息格式 | 
|  */ | 
| public class WebSoketCommonMessage { | 
|   | 
|   | 
|     /** | 
|      * 点对点消息 | 
|      */ | 
|     public static final int MESSAGE_TYPE_P2P=1; | 
|     /** | 
|      * 消息广播 | 
|      */ | 
|     public static final int MESSAGE_TYPE_GROUP=2; | 
|   | 
|     /** | 
|      * 上传消息 | 
|      */ | 
|     public static final int MESSAGE_TYPE_UP=3; | 
|   | 
|     /** | 
|      * 下发消息 | 
|      */ | 
|     public static final int MESSAGE_TYPE_DOWN=4; | 
|   | 
|   | 
|   | 
|     /** | 
|      * 微服务名称 | 
|      */ | 
|     private  String serviceName; | 
|   | 
|     /** | 
|      * 系统环境标识 | 
|      */ | 
|     private String evn; | 
|   | 
|     /** | 
|      * 发送用户id | 
|      */ | 
|     private String userId; | 
|   | 
|     /** | 
|      * 目标用户id | 
|      */ | 
|     private  String targetUserId; | 
|   | 
|     /** | 
|      * 消息体 | 
|      */ | 
|     private String messageBody; | 
|   | 
|     /** | 
|      * 消息类型 | 
|      */ | 
|     private Integer messageType; | 
|   | 
|     public String getServiceName() { | 
|         return serviceName; | 
|     } | 
|   | 
|     public void setServiceName(String serviceName) { | 
|         this.serviceName = serviceName; | 
|     } | 
|   | 
|     public String getEvn() { | 
|         return evn; | 
|     } | 
|   | 
|     public void setEvn(String evn) { | 
|         this.evn = evn; | 
|     } | 
|   | 
|     public String getUserId() { | 
|         return userId; | 
|     } | 
|   | 
|     public void setUserId(String userId) { | 
|         this.userId = userId; | 
|     } | 
|   | 
|     public String getTargetUserId() { | 
|         return targetUserId; | 
|     } | 
|   | 
|     public void setTargetUserId(String targetUserId) { | 
|         this.targetUserId = targetUserId; | 
|     } | 
|   | 
|     public String getMessageBody() { | 
|         return messageBody; | 
|     } | 
|   | 
|     public void setMessageBody(String messageBody) { | 
|         this.messageBody = messageBody; | 
|     } | 
|   | 
|     public Integer getMessageType() { | 
|         return messageType; | 
|     } | 
|   | 
|     public void setMessageType(Integer messageType) { | 
|         this.messageType = messageType; | 
|     } | 
|   | 
|     @Override | 
|     public String toString() { | 
|         return JSONObject.fromObject(this).toString(); | 
|     } | 
|   | 
|   | 
| } |