From d60452560e37305e62f8cdd6cc08c6b3d3430a10 Mon Sep 17 00:00:00 2001 From: WuPeng Date: Sun, 27 Nov 2022 10:28:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=83=E7=94=A8=E5=BA=9F=E5=BC=83=E6=96=B9?= =?UTF-8?q?=E6=B3=95toJavaObject=EF=BC=8C=E6=94=B9=E7=94=A8to=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E6=B6=88=E9=99=A4=E7=BC=96=E8=AF=91=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/service/redisMsg/RedisGbPlayMsgListener.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java index 1330262c..61dea12b 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java @@ -119,7 +119,7 @@ public class RedisGbPlayMsgListener implements MessageListener { while (!taskQueue.isEmpty()) { Message msg = taskQueue.poll(); JSONObject msgJSON = JSON.parseObject(msg.getBody(), JSONObject.class); - WvpRedisMsg wvpRedisMsg = JSON.toJavaObject(msgJSON, WvpRedisMsg.class); + WvpRedisMsg wvpRedisMsg = JSON.to(WvpRedisMsg.class, msgJSON); if (!userSetting.getServerId().equals(wvpRedisMsg.getToId())) { continue; } @@ -128,11 +128,11 @@ public class RedisGbPlayMsgListener implements MessageListener { switch (wvpRedisMsg.getCmd()){ case WvpRedisMsgCmd.GET_SEND_ITEM: - RequestSendItemMsg content = JSON.toJavaObject((JSONObject)wvpRedisMsg.getContent(), RequestSendItemMsg.class); + RequestSendItemMsg content = JSON.to(RequestSendItemMsg.class, wvpRedisMsg.getContent()); requestSendItemMsgHand(content, wvpRedisMsg.getFromId(), wvpRedisMsg.getSerial()); break; case WvpRedisMsgCmd.REQUEST_PUSH_STREAM: - RequestPushStreamMsg param = JSON.toJavaObject((JSONObject)wvpRedisMsg.getContent(), RequestPushStreamMsg.class);; + RequestPushStreamMsg param = JSON.to(RequestPushStreamMsg.class, wvpRedisMsg.getContent());; requestPushStreamMsgHand(param, wvpRedisMsg.getFromId(), wvpRedisMsg.getSerial()); break; default: @@ -144,12 +144,12 @@ public class RedisGbPlayMsgListener implements MessageListener { switch (wvpRedisMsg.getCmd()){ case WvpRedisMsgCmd.GET_SEND_ITEM: - WVPResult content = JSON.toJavaObject((JSONObject)wvpRedisMsg.getContent(), WVPResult.class); + WVPResult content = JSON.to(WVPResult.class, wvpRedisMsg.getContent()); String key = wvpRedisMsg.getSerial(); switch (content.getCode()) { case 0: - ResponseSendItemMsg responseSendItemMsg =JSON.toJavaObject((JSONObject)content.getData(), ResponseSendItemMsg.class); + ResponseSendItemMsg responseSendItemMsg =JSON.to(ResponseSendItemMsg.class, content.getData()); PlayMsgCallback playMsgCallback = callbacks.get(key); if (playMsgCallback != null) { callbacksForError.remove(key); @@ -174,7 +174,7 @@ public class RedisGbPlayMsgListener implements MessageListener { } break; case WvpRedisMsgCmd.REQUEST_PUSH_STREAM: - WVPResult wvpResult = JSON.toJavaObject((JSONObject)wvpRedisMsg.getContent(), WVPResult.class); + WVPResult wvpResult = JSON.to(WVPResult.class, wvpRedisMsg.getContent()); String serial = wvpRedisMsg.getSerial(); switch (wvpResult.getCode()) { case 0: