酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319
以下内容为反编译后的 GetTotalRecentSubscriptionListProtocol.java 源代码,内容仅作参考
package com.kugou.android.app.home.discovery.protocol;
import android.support.v4.app.NotificationCompat;
import c.t;
import com.kugou.android.app.home.channel.f.c;
import com.kugou.android.app.home.channel.protocol.bi;
import com.kugou.android.app.home.discovery.entity.SubscriptionAnliSongEntity;
import com.kugou.android.app.home.discovery.entity.SubscriptionAnliSpecialEntity;
import com.kugou.android.app.home.discovery.entity.SubscriptionContributionEntity;
import com.kugou.android.app.home.discovery.entity.SubscriptionEntity;
import com.kugou.android.topic2.detail.base.CommonListResponse;
import com.kugou.common.network.w;
import com.kugou.common.utils.as;
import d.ab;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import kotlin.Metadata;
import kotlin.jvm.internal.i;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONObject;
import rx.e;
@Metadata(bv = {1, 0, 3}, d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\"\u0010\b\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u000b0\n0\t2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\rJ$\u0010\u000f\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u000b0\n0\t2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\f\u001a\u00020\rH\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0005\u001a\u00020\u00048BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u0012"}, d2 = {"Lcom/kugou/android/app/home/discovery/protocol/GetTotalRecentSubscriptionListProtocol;", "", "()V", "TAG", "", "moduleName", "getModuleName", "()Ljava/lang/String;", "get", "Lrx/Observable;", "Lcom/kugou/android/topic2/detail/base/CommonListResponse;", "Lcom/kugou/android/app/home/discovery/entity/SubscriptionEntity;", "page", "", "lastId", "parseBody", "responseBody", "Lokhttp3/ResponseBody;", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
public final class GetTotalRecentSubscriptionListProtocol {
public static final GetTotalRecentSubscriptionListProtocol f12878a = new GetTotalRecentSubscriptionListProtocol();
private static final String f12879b;
private final String a() {
return "GetTotalRecentSubscriptionListProtocol";
}
static {
String simpleName = GetTotalRecentSubscriptionListProtocol.class.getSimpleName();
i.a((Object) simpleName, "GetTotalRecentSubscripti…ol::class.java.simpleName");
f12879b = simpleName;
}
private GetTotalRecentSubscriptionListProtocol() {
}
@NotNull
public final e<CommonListResponse<SubscriptionEntity>> a(int i, int i2) {
bi biVar = (bi) new t.a().b(a()).a(c.a.a.i.a()).a(w.a(com.kugou.android.app.a.a.Dy, "https://youth.kugou.com/v1/dynamic/get_recent_dynamic")).a(c.b.a.a.a()).a().b().a(bi.class);
LinkedHashMap linkedHashMap = new LinkedHashMap();
linkedHashMap.put("page", String.valueOf(i));
linkedHashMap.put("last_id", String.valueOf(i2));
w.b(linkedHashMap, "");
e c2 = biVar.b(linkedHashMap).c(new a(i));
i.a((Object) c2, "viewInterface.get2(map)\n…Body,page)\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\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\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/home/discovery/entity/SubscriptionEntity;", "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<SubscriptionEntity>>> {
final int f12880a;
a(int i) {
this.f12880a = i;
}
@Override
@NotNull
public final e<CommonListResponse<SubscriptionEntity>> call(ab abVar) {
GetTotalRecentSubscriptionListProtocol getTotalRecentSubscriptionListProtocol = GetTotalRecentSubscriptionListProtocol.f12878a;
i.a((Object) abVar, "responseBody");
return getTotalRecentSubscriptionListProtocol.a(abVar, this.f12880a);
}
}
public final e<CommonListResponse<SubscriptionEntity>> a(ab abVar, int i) {
SubscriptionContributionEntity subscriptionContributionEntity;
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");
commonListResponse.e(optJSONObject != null ? optJSONObject.optInt("is_end", 0) : 0);
commonListResponse.a(optJSONObject != null ? Integer.valueOf(optJSONObject.optInt("last_id", 0)) : 0);
ArrayList arrayList = new ArrayList();
JSONArray optJSONArray = optJSONObject != null ? optJSONObject.optJSONArray("list") : null;
if (optJSONArray != null) {
int length = optJSONArray.length();
for (int i2 = 0; i2 < length; i2++) {
JSONObject jSONObject2 = optJSONArray.getJSONObject(i2);
i.a((Object) jSONObject2, "getJSONObject(index)");
int optInt = jSONObject2.optInt("feed_type");
if (optInt == 1) {
subscriptionContributionEntity = new SubscriptionContributionEntity();
} else if (optInt == 2) {
subscriptionContributionEntity = new SubscriptionAnliSongEntity();
} else {
subscriptionContributionEntity = optInt != 3 ? null : new SubscriptionAnliSpecialEntity();
}
if (subscriptionContributionEntity != null) {
subscriptionContributionEntity.a(jSONObject2);
arrayList.add(subscriptionContributionEntity);
}
}
}
if (arrayList.size() > 0 && i == 1) {
SubscriptionEntity subscriptionEntity = new SubscriptionEntity();
subscriptionEntity.a(999);
subscriptionEntity.a("近期更新");
arrayList.add(0, subscriptionEntity);
}
commonListResponse.a((List) arrayList);
e<CommonListResponse<SubscriptionEntity>> a2 = e.a(commonListResponse);
i.a((Object) a2, "Observable.just(response)");
return a2;
} catch (Exception unused) {
e<CommonListResponse<SubscriptionEntity>> a3 = e.a((Throwable) new c(null));
i.a((Object) a3, "Observable.error<CommonL…nnelParseException(null))");
return a3;
}
}
}