i自然 v1.5.2版本的 MD5 值为:4186de3133535afd3ad8a76e7e4d0eff

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


package com.mnr.app.home.model;

import androidx.lifecycle.MutableLiveData;
import com.mnr.app.app.AppCache;
import com.mnr.app.base.model.BaseModel;
import com.mnr.app.home.bean.Article;
import com.mnr.app.home.bean.ArticleList;
import com.mnr.app.home.bean.ColumnBean;
import com.mnr.app.net.BaseObserver;
import com.mnr.app.net.HttpService;
import com.mnr.app.net.UrlConstKt;
import com.mnr.app.splash.bean.AppConfig;
import com.mnr.app.wedia.bean.MediaListBean;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableSource;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.schedulers.Schedulers;
import java.util.ArrayList;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.internal.Intrinsics;
import okhttp3.ResponseBody;

@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0006\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J.\u0010\u0013\u001a\b\u0012\u0004\u0012\u00020\u00150\u00142\u0006\u0010\u0016\u001a\u00020\u00172\u0006\u0010\u0018\u001a\u00020\u00192\u0006\u0010\u001a\u001a\u00020\u00192\u0006\u0010\u001b\u001a\u00020\u0019H\u0016J\u0014\u0010\u001c\u001a\b\u0012\u0004\u0012\u00020\u00150\u00142\u0006\u0010\u0018\u001a\u00020\u0019J\u0014\u0010\u001d\u001a\b\u0012\u0004\u0012\u00020\u00150\u00142\u0006\u0010\u0018\u001a\u00020\u0019J\u0014\u0010\u001e\u001a\b\u0012\u0004\u0012\u00020\u00150\u00142\u0006\u0010\u0018\u001a\u00020\u0019R \u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\tR \u0010\n\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\u0007\"\u0004\b\f\u0010\tR \u0010\r\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000e\u0010\u0007\"\u0004\b\u000f\u0010\tR \u0010\u0010\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0011\u0010\u0007\"\u0004\b\u0012\u0010\t¨\u0006\u001f"}, d2 = {"Lcom/mnr/app/home/model/ArticleListModel;", "Lcom/mnr/app/base/model/BaseModel;", "()V", "collectArticleList", "Ljava/util/ArrayList;", "Lcom/mnr/app/home/bean/Article;", "getCollectArticleList", "()Ljava/util/ArrayList;", "setCollectArticleList", "(Ljava/util/ArrayList;)V", "likeArticleList", "getLikeArticleList", "setLikeArticleList", "list", "getList", "setList", "subColumnArticleList", "getSubColumnArticleList", "setSubColumnArticleList", "getAllNews", "Landroidx/lifecycle/MutableLiveData;", "Lcom/mnr/app/home/bean/ArticleList;", "cid", "", "refresh", "", "isHome", "isGrandSonColumn", "getCollectArticles", "getLikeArticles", "getSubColumnArticles", "app_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class ArticleListModel extends BaseModel {
    private ArrayList<Article> list = new ArrayList<>();
    private ArrayList<Article> subColumnArticleList = new ArrayList<>();
    private ArrayList<Article> collectArticleList = new ArrayList<>();
    private ArrayList<Article> likeArticleList = new ArrayList<>();

    public final ArrayList<Article> getList() {
        return this.list;
    }

    public final void setList(ArrayList<Article> arrayList) {
        Intrinsics.checkNotNullParameter(arrayList, "<set-?>");
        this.list = arrayList;
    }

    public final ArrayList<Article> getSubColumnArticleList() {
        return this.subColumnArticleList;
    }

    public final void setSubColumnArticleList(ArrayList<Article> arrayList) {
        Intrinsics.checkNotNullParameter(arrayList, "<set-?>");
        this.subColumnArticleList = arrayList;
    }

    public final ArrayList<Article> getCollectArticleList() {
        return this.collectArticleList;
    }

    public final void setCollectArticleList(ArrayList<Article> arrayList) {
        Intrinsics.checkNotNullParameter(arrayList, "<set-?>");
        this.collectArticleList = arrayList;
    }

    public final ArrayList<Article> getLikeArticleList() {
        return this.likeArticleList;
    }

    public final void setLikeArticleList(ArrayList<Article> arrayList) {
        Intrinsics.checkNotNullParameter(arrayList, "<set-?>");
        this.likeArticleList = arrayList;
    }

    public MutableLiveData<ArticleList> getAllNews(int cid, final boolean refresh, boolean isHome, boolean isGrandSonColumn) {
        int fileID;
        MutableLiveData<ArticleList> mutableLiveData;
        int i;
        AppConfig.ConfigBean config;
        AppConfig.ConfigBean config2;
        final MutableLiveData<ArticleList> mutableLiveData2 = new MutableLiveData<>();
        HttpService httpService = HttpService.INSTANCE;
        HashMap hashMap = new HashMap();
        if (isGrandSonColumn) {
            hashMap.put("containSubCols", 1);
        }
        HashMap hashMap2 = hashMap;
        hashMap2.put("cid", Integer.valueOf(cid));
        hashMap2.put("rowNumber", Integer.valueOf(refresh ? 0 : this.list.size()));
        if (refresh) {
            fileID = 0;
        } else {
            ArrayList<Article> arrayList = this.list;
            fileID = arrayList.get(arrayList.size() - 1).getFileID();
        }
        hashMap2.put("lastFileID", Integer.valueOf(fileID));
        hashMap2.put("pageSize", 20);
        hashMap2.put("orderby", "");
        Unit unit = Unit.INSTANCE;
        ObservableSource map = httpService.getNewThread(UrlConstKt.API_GET_ARTICLES, hashMap2).map(new Function() {
            @Override
            public final Object apply(Object obj) {
                ArticleList m166getAllNews$lambda1;
                m166getAllNews$lambda1 = ArticleListModel.m166getAllNews$lambda1(ArticleListModel.this, refresh, (ResponseBody) obj);
                return m166getAllNews$lambda1;
            }
        });
        if (!isHome || !refresh) {
            map.subscribe(new BaseObserver<ArticleList>(this) {
                {
                    super(this);
                }

                @Override
                public void onNextBase(ArticleList t) {
                    Intrinsics.checkNotNullParameter(t, "t");
                    mutableLiveData2.setValue(t);
                }

                @Override
                public void onErrorBase(Throwable e) {
                    ArticleList articleList = new ArticleList();
                    articleList.setMsg(e != null ? e.getMessage() : null);
                    mutableLiveData2.setValue(articleList);
                }
            });
            return mutableLiveData2;
        }
        AppConfig config3 = AppCache.INSTANCE.getConfig();
        AppConfig.ConfigBean.HomeBean homeBean = null;
        AppConfig.ConfigBean.HomeBean home = (config3 == null || (config2 = config3.getConfig()) == null) ? null : config2.getHome();
        HttpService httpService2 = HttpService.INSTANCE;
        HashMap hashMap3 = new HashMap();
        AppConfig config4 = AppCache.INSTANCE.getConfig();
        if (config4 != null && (config = config4.getConfig()) != null) {
            homeBean = config.getHome();
        }
        HashMap hashMap4 = hashMap3;
        hashMap4.put("cid", Integer.valueOf(homeBean != null ? homeBean.getHeadlineColumnId() : 0));
        hashMap4.put("rowNumber", 0);
        hashMap4.put("lastFileID", 0);
        hashMap4.put("pageSize", 20);
        hashMap4.put("orderby", "");
        Observable observeOn = httpService2.getApiService().get(UrlConstKt.API_GET_ARTICLES, hashMap4).map(new Function() {
            @Override
            public final T apply(ResponseBody responseBody) {
                return (T) HttpService.INSTANCE.getGson().fromJson(responseBody.string(), (Class) ArticleList.class);
            }
        }).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread());
        Intrinsics.checkNotNullExpressionValue(observeOn, "apiService.get(url, map)…dSchedulers.mainThread())");
        HttpService httpService3 = HttpService.INSTANCE;
        HashMap hashMap5 = new HashMap();
        if (home != null) {
            i = home.getTopNewsColumnId();
            mutableLiveData = mutableLiveData2;
        } else {
            mutableLiveData = mutableLiveData2;
            i = 0;
        }
        hashMap5.put("cid", Integer.valueOf(i));
        hashMap5.put("rowNumber", 0);
        hashMap5.put("lastFileID", 0);
        hashMap5.put("pageSize", 20);
        hashMap5.put("orderby", "");
        Observable observeOn2 = httpService3.getApiService().get(UrlConstKt.API_GET_ARTICLES, hashMap5).map(new Function() {
            @Override
            public final T apply(ResponseBody responseBody) {
                return (T) HttpService.INSTANCE.getGson().fromJson(responseBody.string(), (Class) ArticleList.class);
            }
        }).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread());
        Intrinsics.checkNotNullExpressionValue(observeOn2, "apiService.get(url, map)…dSchedulers.mainThread())");
        HttpService httpService4 = HttpService.INSTANCE;
        HashMap hashMap6 = new HashMap();
        hashMap6.put("cid", 20502);
        hashMap6.put("rowNumber", 0);
        hashMap6.put("lastFileID", 0);
        hashMap6.put("pageSize", 20);
        hashMap6.put("orderby", "");
        Unit unit2 = Unit.INSTANCE;
        httpService4.getNewThread(UrlConstKt.API_GET_ARTICLES, hashMap6).map(new Function() {
            @Override
            public final Object apply(Object obj) {
                ArticleList m168getAllNews$lambda5;
                m168getAllNews$lambda5 = ArticleListModel.m168getAllNews$lambda5(ArticleListModel.this, (ResponseBody) obj);
                return m168getAllNews$lambda5;
            }
        });
        HttpService httpService5 = HttpService.INSTANCE;
        HashMap hashMap7 = new HashMap();
        hashMap7.put("cid", 29862);
        hashMap7.put("rowNumber", 0);
        hashMap7.put("lastFileID", 0);
        hashMap7.put("pageSize", 20);
        hashMap7.put("orderby", "");
        Unit unit3 = Unit.INSTANCE;
        httpService5.getNewThread(UrlConstKt.API_GET_ARTICLES, hashMap7).map(new Function() {
            @Override
            public final Object apply(Object obj) {
                ArticleList m169getAllNews$lambda7;
                m169getAllNews$lambda7 = ArticleListModel.m169getAllNews$lambda7(ArticleListModel.this, (ResponseBody) obj);
                return m169getAllNews$lambda7;
            }
        });
        HttpService httpService6 = HttpService.INSTANCE;
        HashMap hashMap8 = new HashMap();
        hashMap8.put("cid", Integer.valueOf(home != null ? home.getTopSpecialColumnId() : 0));
        hashMap8.put("rowNumber", 0);
        hashMap8.put("lastFileID", 0);
        hashMap8.put("pageSize", 20);
        hashMap8.put("orderby", "");
        Observable observeOn3 = httpService6.getApiService().get(UrlConstKt.API_GET_ARTICLES, hashMap8).map(new Function() {
            @Override
            public final T apply(ResponseBody responseBody) {
                return (T) HttpService.INSTANCE.getGson().fromJson(responseBody.string(), (Class) ArticleList.class);
            }
        }).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread());
        Intrinsics.checkNotNullExpressionValue(observeOn3, "apiService.get(url, map)…dSchedulers.mainThread())");
        HttpService httpService7 = HttpService.INSTANCE;
        HashMap hashMap9 = new HashMap();
        hashMap9.put("cid", 557107);
        hashMap9.put("rowNumber", 0);
        hashMap9.put("lastFileID", 0);
        hashMap9.put("pageSize", 20);
        hashMap9.put("orderby", "");
        Observable observeOn4 = httpService7.getApiService().get(UrlConstKt.API_GET_ARTICLES, hashMap9).map(new Function() {
            @Override
            public final T apply(ResponseBody responseBody) {
                return (T) HttpService.INSTANCE.getGson().fromJson(responseBody.string(), (Class) ArticleList.class);
            }
        }).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread());
        Intrinsics.checkNotNullExpressionValue(observeOn4, "apiService.get(url, map)…dSchedulers.mainThread())");
        HttpService httpService8 = HttpService.INSTANCE;
        HashMap hashMap10 = new HashMap();
        getUserInfo();
        HashMap hashMap11 = hashMap10;
        hashMap11.put("catalogID", "");
        hashMap11.put("userID", Integer.valueOf(getMUid()));
        hashMap11.put("userIDSign", getMUiddesign());
        Unit unit4 = Unit.INSTANCE;
        ObservableSource[] observableSourceArr = {map, observeOn, observeOn2, observeOn4, httpService8.getNewThread("https://api.iziran.net/media/recommendMedia", hashMap11).map(new Function() {
            @Override
            public final Object apply(Object obj) {
                ArticleList m167getAllNews$lambda13;
                m167getAllNews$lambda13 = ArticleListModel.m167getAllNews$lambda13(ArticleListModel.this, (ResponseBody) obj);
                return m167getAllNews$lambda13;
            }
        }), observeOn3};
        final MutableLiveData<ArticleList> mutableLiveData3 = mutableLiveData;
        Observable.concatArray(observableSourceArr).subscribe(new BaseObserver<ArticleList>(this) {
            {
                super(this);
            }

            @Override
            public void onNextBase(ArticleList t) {
                Intrinsics.checkNotNullParameter(t, "t");
                mutableLiveData3.setValue(t);
            }

            @Override
            public void onErrorBase(Throwable e) {
                ArticleList articleList = new ArticleList();
                articleList.setMsg(e != null ? e.getMessage() : null);
                mutableLiveData3.setValue(articleList);
            }
        });
        return mutableLiveData3;
    }

    public static final ArticleList m166getAllNews$lambda1(ArticleListModel this$0, boolean z, ResponseBody responseBody) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        ArticleList articleList = (ArticleList) this$0.getGson().fromJson(responseBody.string(), ArticleList.class);
        if (articleList.getList() != null && articleList.getList().size() != 0) {
            if (z) {
                ArrayList<Article> list = articleList.getList();
                Intrinsics.checkNotNullExpressionValue(list, "data.list");
                this$0.list = list;
            } else {
                this$0.list.addAll(articleList.getList());
            }
        }
        return articleList;
    }

    public static final ArticleList m168getAllNews$lambda5(ArticleListModel this$0, ResponseBody responseBody) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        return (ArticleList) this$0.getGson().fromJson(responseBody.string(), ArticleList.class);
    }

    public static final ArticleList m169getAllNews$lambda7(ArticleListModel this$0, ResponseBody responseBody) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        return (ArticleList) this$0.getGson().fromJson(responseBody.string(), ArticleList.class);
    }

    public static final ArticleList m167getAllNews$lambda13(ArticleListModel this$0, ResponseBody responseBody) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        MediaListBean mediaListBean = (MediaListBean) this$0.getGson().fromJson(responseBody.string(), MediaListBean.class);
        ArticleList articleList = new ArticleList();
        ColumnBean columnBean = new ColumnBean();
        columnBean.setColumnID(-1);
        columnBean.setColumnName("推荐自然号");
        articleList.setColumn(columnBean);
        articleList.setMediaListBean(mediaListBean.getList());
        return articleList;
    }

    public final MutableLiveData<ArticleList> getSubColumnArticles(final boolean refresh) {
        final MutableLiveData<ArticleList> mutableLiveData = new MutableLiveData<>();
        if (getUserInfo() == null) {
            this.subColumnArticleList.clear();
            mutableLiveData.setValue(new ArticleList());
            return mutableLiveData;
        }
        HashMap hashMap = new HashMap();
        hashMap.put("uid", Integer.valueOf(getMUid()));
        int i = 0;
        hashMap.put("rowNumber", Integer.valueOf(refresh ? 0 : this.subColumnArticleList.size()));
        if (!refresh) {
            i = this.subColumnArticleList.get(r2.size() - 1).getFileID();
        }
        hashMap.put("lastFileID", Integer.valueOf(i));
        hashMap.put("pageSize", 20);
        HttpService.INSTANCE.getNewThread("https://api.iziran.net/columnSubscribe/myArticles", hashMap).map(new Function() {
            @Override
            public final Object apply(Object obj) {
                ArticleList m172getSubColumnArticles$lambda15;
                m172getSubColumnArticles$lambda15 = ArticleListModel.m172getSubColumnArticles$lambda15(ArticleListModel.this, refresh, (ResponseBody) obj);
                return m172getSubColumnArticles$lambda15;
            }
        }).subscribe(new BaseObserver<ArticleList>(this) {
            {
                super(this);
            }

            @Override
            public void onNextBase(ArticleList t) {
                Intrinsics.checkNotNullParameter(t, "t");
                mutableLiveData.setValue(t);
            }

            @Override
            public void onErrorBase(Throwable e) {
                ArticleList articleList = new ArticleList();
                articleList.setMsg(e != null ? e.getMessage() : null);
                mutableLiveData.setValue(articleList);
            }
        });
        return mutableLiveData;
    }

    public static final ArticleList m172getSubColumnArticles$lambda15(ArticleListModel this$0, boolean z, ResponseBody responseBody) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        ArticleList articleList = (ArticleList) this$0.getGson().fromJson(responseBody.string(), ArticleList.class);
        if (articleList.getList() != null && articleList.getList().size() != 0) {
            if (z) {
                ArrayList<Article> list = articleList.getList();
                Intrinsics.checkNotNullExpressionValue(list, "data.list");
                this$0.subColumnArticleList = list;
            } else {
                this$0.subColumnArticleList.addAll(articleList.getList());
            }
        }
        return articleList;
    }

    public final MutableLiveData<ArticleList> getCollectArticles(final boolean refresh) {
        final MutableLiveData<ArticleList> mutableLiveData = new MutableLiveData<>();
        if (getUserInfo() == null) {
            this.collectArticleList.clear();
            mutableLiveData.setValue(new ArticleList());
            return mutableLiveData;
        }
        HashMap hashMap = new HashMap();
        hashMap.put("uid", Integer.valueOf(getMUid()));
        hashMap.put("rowNumber", Integer.valueOf(refresh ? 0 : this.collectArticleList.size()));
        hashMap.put("pageSize", 20);
        HttpService.INSTANCE.getNewThread(UrlConstKt.API_GET_MYCOLLECT_ARTICLES, hashMap).map(new Function() {
            @Override
            public final Object apply(Object obj) {
                ArticleList m170getCollectArticles$lambda16;
                m170getCollectArticles$lambda16 = ArticleListModel.m170getCollectArticles$lambda16(ArticleListModel.this, refresh, (ResponseBody) obj);
                return m170getCollectArticles$lambda16;
            }
        }).subscribe(new BaseObserver<ArticleList>(this) {
            {
                super(this);
            }

            @Override
            public void onNextBase(ArticleList t) {
                Intrinsics.checkNotNullParameter(t, "t");
                mutableLiveData.setValue(t);
            }
        });
        return mutableLiveData;
    }

    public static final ArticleList m170getCollectArticles$lambda16(ArticleListModel this$0, boolean z, ResponseBody responseBody) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        ArticleList articleList = (ArticleList) this$0.getGson().fromJson(responseBody.string(), ArticleList.class);
        if (articleList.getList() != null && articleList.getList().size() != 0) {
            if (z) {
                ArrayList<Article> list = articleList.getList();
                Intrinsics.checkNotNullExpressionValue(list, "data.list");
                this$0.collectArticleList = list;
            } else {
                this$0.collectArticleList.addAll(articleList.getList());
            }
        }
        return articleList;
    }

    public final MutableLiveData<ArticleList> getLikeArticles(final boolean refresh) {
        final MutableLiveData<ArticleList> mutableLiveData = new MutableLiveData<>();
        if (getUserInfo() == null) {
            mutableLiveData.setValue(new ArticleList());
            return mutableLiveData;
        }
        HashMap hashMap = new HashMap();
        hashMap.put("userID", Integer.valueOf(getMUid()));
        hashMap.put("userIDSign", getMUiddesign());
        hashMap.put("rowNumber", Integer.valueOf(refresh ? 0 : this.likeArticleList.size()));
        hashMap.put("pageSize", 20);
        HttpService.INSTANCE.getNewThread(UrlConstKt.API_GET_MYLIKE_ARTICLES, hashMap).map(new Function() {
            @Override
            public final Object apply(Object obj) {
                ArticleList m171getLikeArticles$lambda17;
                m171getLikeArticles$lambda17 = ArticleListModel.m171getLikeArticles$lambda17(ArticleListModel.this, refresh, (ResponseBody) obj);
                return m171getLikeArticles$lambda17;
            }
        }).subscribe(new BaseObserver<ArticleList>(this) {
            {
                super(this);
            }

            @Override
            public void onNextBase(ArticleList t) {
                Intrinsics.checkNotNullParameter(t, "t");
                mutableLiveData.setValue(t);
            }
        });
        return mutableLiveData;
    }

    public static final ArticleList m171getLikeArticles$lambda17(ArticleListModel this$0, boolean z, ResponseBody responseBody) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        ArticleList articleList = (ArticleList) this$0.getGson().fromJson(responseBody.string(), ArticleList.class);
        if (articleList.getList() != null && articleList.getList().size() != 0) {
            if (z) {
                ArrayList<Article> list = articleList.getList();
                Intrinsics.checkNotNullExpressionValue(list, "data.list");
                this$0.likeArticleList = list;
            } else {
                this$0.likeArticleList.addAll(articleList.getList());
            }
        }
        return articleList;
    }
}