From 5d314d3f88e72effee7d3a40802cd12f6bd7f582 Mon Sep 17 00:00:00 2001 From: heavyrain2012 Date: Thu, 22 Oct 2020 11:21:03 +0800 Subject: [PATCH] add hugup voip reason --- src/main/java/cn/wildfirechat/app/ServiceImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/cn/wildfirechat/app/ServiceImpl.java b/src/main/java/cn/wildfirechat/app/ServiceImpl.java index 2a49ea3..f0a5035 100644 --- a/src/main/java/cn/wildfirechat/app/ServiceImpl.java +++ b/src/main/java/cn/wildfirechat/app/ServiceImpl.java @@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; +import sun.misc.BASE64Encoder; import javax.annotation.PostConstruct; import javax.validation.Payload; @@ -131,16 +132,16 @@ public RestResult onReceiveMessage(SendMessageData messageData) { e.printStackTrace(); } } - } else if (messageData.getPayload().getType() == 2) { + } else if (messageData.getPayload().getType() == 3) { localResponse = false; response = "不好意思,我还不会看照片哟~"; - } else if (messageData.getPayload().getType() == 3) { + } else if (messageData.getPayload().getType() == 2) { localResponse = false; response = "不好意思,我还不会听声音哟~"; } else if (messageData.getPayload().getType() == 4) { localResponse = false; response = "这是那里?我还没有学会看地图啊!"; - } else if (messageData.getPayload().getType() == 5) { + } else if (messageData.getPayload().getType() == 6) { localResponse = false; response = "我也想看视频,可惜我还没学会!"; } else if (messageData.getPayload().getType() == 400) { @@ -150,6 +151,8 @@ public RestResult onReceiveMessage(SendMessageData messageData) { MessagePayload payload = new MessagePayload(); payload.setType(402); payload.setContent(messageData.getPayload().getContent()); + String reason = "{\"r\":5}"; + payload.setBase64edData(new BASE64Encoder().encode(reason.getBytes())); try { RobotService.sendMessage(mRobotConfig.getIm_id(), conversation, payload); } catch (Exception e) {