From 2843131151a128c5dca424ff7124247430c26a59 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 26 Nov 2022 14:36:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9E=E9=BA=A6=E7=9C=8B?= =?UTF-8?q?=E8=A7=82=E4=BC=97=E5=88=97=E8=A1=A8json=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/bean/LiveUserGiftBean.java | 37 +++++++++++++++++++ .../yunbao/live/socket/SocketRyClient.java | 3 +- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/bean/LiveUserGiftBean.java b/common/src/main/java/com/yunbao/common/bean/LiveUserGiftBean.java index 51ded39f5..118825cd0 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveUserGiftBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveUserGiftBean.java @@ -62,4 +62,41 @@ public class LiveUserGiftBean extends UserBean { public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); } + + @Override + public String toString() { + return "LiveUserGiftBean{" + + "contribution='" + contribution + '\'' + + ", guardType=" + guardType + + ", nub=" + nub + + ", id='" + id + '\'' + + ", userNiceName='" + userNiceName + '\'' + + ", avatar='" + avatar + '\'' + + ", avatarThumb='" + avatarThumb + '\'' + + ", sex=" + sex + + ", signature='" + signature + '\'' + + ", coin='" + coin + '\'' + + ", gold='" + gold + '\'' + + ", votes='" + votes + '\'' + + ", consumption='" + consumption + '\'' + + ", votestotal='" + votestotal + '\'' + + ", province='" + province + '\'' + + ", city='" + city + '\'' + + ", location='" + location + '\'' + + ", birthday='" + birthday + '\'' + + ", level=" + level + + ", levelAnchor=" + levelAnchor + + ", lives=" + lives + + ", follows=" + follows + + ", fans=" + fans + + ", vip=" + vip + + ", liang=" + liang + + ", car=" + car + + ", medal_level=" + medal_level + + ", medal_name='" + medal_name + '\'' + + ", Dress=" + Dress + + ", noble_id='" + noble_id + '\'' + + ", yuanbao='" + yuanbao + '\'' + + '}'; + } } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 389604dd0..9e4fce7b6 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -200,8 +200,7 @@ public class SocketRyClient { mListener.onUpUserList(map.getJSONObject("ct")); EventBus.getDefault().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_UPDATE_AUDIENCE_LIST) - .setObject( GsonUtils.fromJson(map.getJSONObject("ct").getString("userlist"), new TypeToken>() { - }.getType())) + .setObject(JSON.parseArray(map.getJSONObject("ct").getString("userlist"), LiveUserGiftBean.class)) ); break; case Constants.CARD: