|
@@ -245,8 +245,8 @@ public class WebSocketServer {
|
|
|
*/
|
|
|
public static CommunityChatMsg saveChat(String message) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(message);
|
|
|
- Long sendUserId = jsonObject.getLong("sendUserId");
|
|
|
- Long receiveUserId = jsonObject.getLong("receiveUserId");
|
|
|
+ Long senderId = jsonObject.getLong("senderId");
|
|
|
+ Long receiverId = jsonObject.getLong("receiverId");
|
|
|
String type = jsonObject.getString("type"); //消息分类 chat
|
|
|
int messageType = jsonObject.getInteger("messageType"); //消息类型
|
|
|
// JSONObject sendText = jsonObject.getJSONObject("sendText");
|
|
@@ -256,9 +256,9 @@ public class WebSocketServer {
|
|
|
// sendToUser(String.valueOf(receiveUserId), JSONObject.toJSONString(jsonObject));
|
|
|
|
|
|
chatMsg = new CommunityChatMsg();
|
|
|
- chatMsg.setSenderId(sendUserId);
|
|
|
- chatMsg.setReceiverId(receiveUserId);
|
|
|
- chatMsg.setCreateBy(sendUserId);
|
|
|
+ chatMsg.setSenderId(senderId);
|
|
|
+ chatMsg.setReceiverId(receiverId);
|
|
|
+ chatMsg.setCreateBy(senderId);
|
|
|
chatMsg.setRead(false);
|
|
|
chatMsg.setMessageType(messageType);
|
|
|
chatMsg.setCreateTime(DateUtils.parseDate(DateUtils.getTime()));
|
|
@@ -297,4 +297,5 @@ public class WebSocketServer {
|
|
|
}
|
|
|
return chatMsg;
|
|
|
}
|
|
|
+
|
|
|
}
|