酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319

以下内容为反编译后的 GetUserLikeRoomListProtocol.java 源代码,内容仅作参考


package com.kugou.android.app.studyroom.protocol;

import android.support.v4.app.NotificationCompat;
import c.a.a.i;
import c.t;
import com.google.gson.Gson;
import com.kugou.android.app.home.channel.f.c;
import com.kugou.android.app.home.channel.protocol.bi;
import com.kugou.android.app.studyroom.entity.SelfStudyRoomInfo;
import com.kugou.android.topic2.detail.base.CommonListResponse;
import com.kugou.common.network.w;
import com.kugou.common.utils.as;
import com.qq.e.comm.constants.TangramHippyConstants;
import d.ab;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import kotlin.Metadata;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONArray;
import org.json.JSONObject;
import rx.e;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u001a\u0010\u0003\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00060\u00050\u00042\u0006\u0010\u0007\u001a\u00020\bJ\u001e\u0010\t\u001a\u0010\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00060\u0005\u0018\u00010\u00042\u0006\u0010\n\u001a\u00020\u000bH\u0002¨\u0006\f"}, d2 = {"Lcom/kugou/android/app/studyroom/protocol/GetUserLikeRoomListProtocol;", "", "()V", "getList", "Lrx/Observable;", "Lcom/kugou/android/topic2/detail/base/CommonListResponse;", "Lcom/kugou/android/app/studyroom/entity/SelfStudyRoomInfo;", "page", "", "parseBody", "responseBody", "Lokhttp3/ResponseBody;", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
public final class GetUserLikeRoomListProtocol {

    public static final GetUserLikeRoomListProtocol f19940a = new GetUserLikeRoomListProtocol();

    private GetUserLikeRoomListProtocol() {
    }

    @NotNull
    public final e<CommonListResponse<SelfStudyRoomInfo>> a(int i) {
        bi biVar = (bi) new t.a().b("StudyRoom").a(i.a()).a(w.a(com.kugou.android.app.a.a.BD, "https://youth.kugou.com/v1/study/user_like_room_list")).a(c.b.a.a.a()).a().b().a(bi.class);
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("page", String.valueOf(i));
        e c2 = biVar.b(w.b(linkedHashMap, "")).c(a.f19942a);
        kotlin.jvm.internal.i.a((Object) c2, "viewInterface.get2(map)\n…ponseBody)\n            })");
        return c2;
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0018\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u0010\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u0002\u0018\u00010\u00012\u000e\u0010\u0004\u001a\n \u0006*\u0004\u0018\u00010\u00050\u0005H\n¢\u0006\u0002\b\u0007"}, d2 = {"<anonymous>", "Lrx/Observable;", "Lcom/kugou/android/topic2/detail/base/CommonListResponse;", "Lcom/kugou/android/app/studyroom/entity/SelfStudyRoomInfo;", "responseBody", "Lokhttp3/ResponseBody;", "kotlin.jvm.PlatformType", NotificationCompat.CATEGORY_CALL}, k = 3, mv = {1, 1, 15})
    static final class a<T, R> implements rx.b.e<ab, e<CommonListResponse<SelfStudyRoomInfo>>> {

        public static final a f19942a = new a();

        a() {
        }

        @Override
        @Nullable
        public final e<CommonListResponse<SelfStudyRoomInfo>> call(ab abVar) {
            GetUserLikeRoomListProtocol getUserLikeRoomListProtocol = GetUserLikeRoomListProtocol.f19940a;
            kotlin.jvm.internal.i.a((Object) abVar, "responseBody");
            return getUserLikeRoomListProtocol.a(abVar);
        }
    }

    public final e<CommonListResponse<SelfStudyRoomInfo>> a(ab abVar) {
        try {
            CommonListResponse commonListResponse = new CommonListResponse(0, null, 0, 0, null, 31, null);
            String f = abVar.f();
            as.f("lzq-young", f);
            JSONObject jSONObject = new JSONObject(f);
            commonListResponse.a(jSONObject.getInt("status"));
            commonListResponse.b(jSONObject.getInt("error_code"));
            commonListResponse.a(jSONObject.getString("error_msg"));
            JSONObject optJSONObject = jSONObject.optJSONObject("data");
            if (commonListResponse.b() && optJSONObject != null) {
                commonListResponse.e(optJSONObject.optInt("is_end"));
                commonListResponse.g(optJSONObject.optInt(TangramHippyConstants.COUNT));
                JSONArray optJSONArray = optJSONObject.optJSONArray("list");
                ArrayList arrayList = new ArrayList();
                if (optJSONArray != null) {
                    int length = optJSONArray.length();
                    for (int i = 0; i < length; i++) {
                        JSONObject jSONObject2 = optJSONArray.getJSONObject(i);
                        kotlin.jvm.internal.i.a((Object) jSONObject2, "getJSONObject(index)");
                        Object fromJson = new Gson().fromJson(jSONObject2.toString(), (Class<Object>) SelfStudyRoomInfo.class);
                        kotlin.jvm.internal.i.a(fromJson, "Gson().fromJson(it.toStr…tudyRoomInfo::class.java)");
                        arrayList.add(fromJson);
                    }
                }
                commonListResponse.a((List) arrayList);
            }
            return e.a(commonListResponse);
        } catch (Exception unused) {
            return e.a((Throwable) new c(null));
        }
    }
}