diff --git a/mall-im/src/main/java/com/suisung/mall/im/common/websocket/service/onchat/MallsuiteImSocketHandler.java b/mall-im/src/main/java/com/suisung/mall/im/common/websocket/service/onchat/MallsuiteImSocketHandler.java index b106263b..3e552707 100644 --- a/mall-im/src/main/java/com/suisung/mall/im/common/websocket/service/onchat/MallsuiteImSocketHandler.java +++ b/mall-im/src/main/java/com/suisung/mall/im/common/websocket/service/onchat/MallsuiteImSocketHandler.java @@ -205,7 +205,9 @@ public class MallsuiteImSocketHandler implements WebSocketHandler { if (!mine.getId().equals(to.getId())) { sendVO.setMine(false); - + if ("voice".equals(receiveDTO.getMine().getType()) || "video".equals(receiveDTO.getMine().getType())) { + sendVO.setMessage_length(receiveDTO.getMine().getContent()); + } //保存聊天记录 if ("friend".equals(type) || "user".equals(type)) { //如果是私聊 diff --git a/mall-im/src/main/java/com/suisung/mall/im/pojo/vo/SendVO.java b/mall-im/src/main/java/com/suisung/mall/im/pojo/vo/SendVO.java index ddf36383..1d71302c 100644 --- a/mall-im/src/main/java/com/suisung/mall/im/pojo/vo/SendVO.java +++ b/mall-im/src/main/java/com/suisung/mall/im/pojo/vo/SendVO.java @@ -76,6 +76,9 @@ public class SendVO implements Serializable { @ApiModelProperty(value = "和状态一致") private Map msg; + @ApiModelProperty(value = "消息长度") + private String message_length; + @Override public String toString() {