Skip to content

Commit

Permalink
NGA后台又改数据格式,重新做兼容
Browse files Browse the repository at this point in the history
  • Loading branch information
Justwen committed Apr 2, 2024
1 parent ec6a615 commit b733097
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public static class TBean {
* 0 : 275
* 2 : 测试版面
*/
private Map<String, String> parent;
public String parent;

public Map<String, String> topic_misc_var;

Expand Down Expand Up @@ -405,14 +405,6 @@ public void setTpcurl(String tpcurl) {
this.tpcurl = tpcurl;
}

public Map<String, String> getParent() {
return parent;
}

public void setParent(Map<String, String> parent) {
this.parent = parent;
}

public PBean get__P() {
return __P;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -219,9 +220,14 @@ private void convertTopic(TopicListInfo listInfo, TopicListBean topicListBean, i
pageInfo.setReplyInfo(replyInfo);
}

Map<String, String> 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());
Expand Down

0 comments on commit b733097

Please sign in to comment.