예제 #1
0
  /**
   * @param content
   * @return 赞
   */
  public static List<VideoBean> parse_zan(String content) {
    List<VideoBean> dates = new ArrayList<VideoBean>();
    try {
      JSONObject jsonobject = new JSONObject(content);
      JSONArray ja = new JSONArray(jsonobject.getString("data"));
      for (int i = 0; i < ja.length(); i++) {
        JSONObject jsonobject2 = ja.getJSONObject(i).getJSONObject("identityBase");
        VideoBean vipRoomBean = new VideoBean();
        vipRoomBean.identityTitle = jsonobject2.getString("identityTitle");
        vipRoomBean.myLogo = jsonobject2.getString("myLogo");
        vipRoomBean.aboutMe = jsonobject2.getString("aboutMe");
        vipRoomBean.verified = jsonobject2.getInt("verified");
        vipRoomBean.isDefault = jsonobject2.getBoolean("isDefault");
        vipRoomBean.userId = jsonobject2.getInt("userId");

        vipRoomBean.identityId = jsonobject2.getLong("identityId");
        vipRoomBean.followingNum = jsonobject2.getInt("followingNum");
        vipRoomBean.followedNum = jsonobject2.getInt("followedNum");
        vipRoomBean.speakCount = jsonobject2.getInt("speakCount");
        vipRoomBean.autoFollowing = jsonobject2.getInt("autoFollowing");
        vipRoomBean.autoFollowed = jsonobject2.getInt("autoFollowed");
        vipRoomBean.displayName = jsonobject2.getString("displayName");
        vipRoomBean.viewCount = jsonobject2.getInt("viewCount");

        JSONObject jsonobject3 = ja.getJSONObject(i).getJSONObject("onlineTeachLiked");
        vipRoomBean.createTime = jsonobject3.getLong("createTime");
        dates.add(vipRoomBean);
      }
      return dates;
    } catch (JSONException e) {
      e.printStackTrace();
    }
    return dates;
  }
예제 #2
0
  /**
   * @param content
   * @return 在线教学视频
   */
  @SuppressLint("NewApi")
  public static List<VideoBean> parse_LinVideos(String content) {
    List<VideoBean> dates = new ArrayList<VideoBean>();
    try {
      JSONObject jsonobject = new JSONObject(content);
      JSONArray ja = new JSONArray(jsonobject.getString("data"));
      for (int i = 0; i < ja.length(); i++) {

        VideoBean vipRoomBean = new VideoBean();
        JSONArray jsonArray = new JSONArray(ja.getJSONObject(i).getString("onlineTeachLikedlist"));
        if (jsonArray.length() > 0) {
          for (int j = 0; j < jsonArray.length(); j++) {

            JSONObject jsonObject3 = jsonArray.getJSONObject(j);
            vipRoomBean.newidentityId = jsonObject3.getLong("identityId");
          }
        }
        JSONObject jsonobject2 = ja.getJSONObject(i).getJSONObject("identityBase");
        vipRoomBean.identityTitle = jsonobject2.getString("identityTitle");
        vipRoomBean.myLogo = jsonobject2.getString("myLogo");
        vipRoomBean.aboutMe = jsonobject2.getString("aboutMe");
        vipRoomBean.verified = jsonobject2.getInt("verified");
        vipRoomBean.isDefault = jsonobject2.getBoolean("isDefault");
        vipRoomBean.userId = jsonobject2.getInt("userId");
        vipRoomBean.identityId = jsonobject2.getLong("identityId");
        vipRoomBean.followingNum = jsonobject2.getInt("followingNum");
        vipRoomBean.followedNum = jsonobject2.getInt("followedNum");
        vipRoomBean.speakCount = jsonobject2.getInt("speakCount");
        vipRoomBean.autoFollowing = jsonobject2.getInt("autoFollowing");
        vipRoomBean.autoFollowed = jsonobject2.getInt("autoFollowed");
        vipRoomBean.displayName = jsonobject2.getString("displayName");
        vipRoomBean.viewCount = jsonobject2.getInt("viewCount");

        JSONObject jsonobject3 = ja.getJSONObject(i).getJSONObject("onlineTeachSpeak");
        vipRoomBean.commentCount = jsonobject3.getInt("commentCount");
        vipRoomBean.realAudioUrl = jsonobject3.getString("realAudioUrl");
        vipRoomBean.realPicUrl = jsonobject3.getString("realPicUrl");
        vipRoomBean.speakId = jsonobject3.getInt("speakId");
        vipRoomBean.likeNum = jsonobject3.getInt("likeNum");
        vipRoomBean.createTime = jsonobject3.getLong("createTime");
        vipRoomBean.content = jsonobject3.getString("content");
        dates.add(vipRoomBean);
      }
      return dates;
    } catch (JSONException e) {
      e.printStackTrace();
    }
    return dates;
  }