From b733097a5a617c017a3025210dfa2bac9bae6df4 Mon Sep 17 00:00:00 2001 From: Justwen Date: Tue, 2 Apr 2024 21:57:27 +0800 Subject: [PATCH] =?UTF-8?q?NGA=E5=90=8E=E5=8F=B0=E5=8F=88=E6=94=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=EF=BC=8C=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=81=9A=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/sp/phone/http/bean/TopicListBean.java | 10 +--------- .../phone/mvp/model/convert/TopicConvertFactory.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/nga_phone_base_3.0/src/main/java/sp/phone/http/bean/TopicListBean.java b/nga_phone_base_3.0/src/main/java/sp/phone/http/bean/TopicListBean.java index 57bbb641a..da4973f88 100644 --- a/nga_phone_base_3.0/src/main/java/sp/phone/http/bean/TopicListBean.java +++ b/nga_phone_base_3.0/src/main/java/sp/phone/http/bean/TopicListBean.java @@ -257,7 +257,7 @@ public static class TBean { * 0 : 275 * 2 : 测试版面 */ - private Map parent; + public String parent; public Map topic_misc_var; @@ -405,14 +405,6 @@ public void setTpcurl(String tpcurl) { this.tpcurl = tpcurl; } - public Map getParent() { - return parent; - } - - public void setParent(Map parent) { - this.parent = parent; - } - public PBean get__P() { return __P; } diff --git a/nga_phone_base_3.0/src/main/java/sp/phone/mvp/model/convert/TopicConvertFactory.java b/nga_phone_base_3.0/src/main/java/sp/phone/mvp/model/convert/TopicConvertFactory.java index fbcf6f7fc..c438612ae 100644 --- a/nga_phone_base_3.0/src/main/java/sp/phone/mvp/model/convert/TopicConvertFactory.java +++ b/nga_phone_base_3.0/src/main/java/sp/phone/mvp/model/convert/TopicConvertFactory.java @@ -3,6 +3,7 @@ import android.text.TextUtils; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import java.util.Collections; import java.util.Comparator; @@ -219,9 +220,14 @@ private void convertTopic(TopicListInfo listInfo, TopicListBean topicListBean, i pageInfo.setReplyInfo(replyInfo); } - Map parent = tBean.getParent(); - if (parent != null) { - pageInfo.setBoard(parent.get("2")); + String parent = tBean.parent; + if (!TextUtils.isEmpty(parent)) { + try { + JSONObject obj = JSON.parseObject(parent); + pageInfo.setBoard(Objects.requireNonNull(obj.get("2")).toString()); + } catch (Exception e) { + // ignore + } } pageInfo.setPostDate(tBean.getPostdate());