use of com.example.jingbin.cloudreader.bean.wanandroid.WxarticleDetailItemBean in project CloudReader by youlookwhat.
the class WanFindViewModel method getWxarticleDetail.
public void getWxarticleDetail(int id) {
Disposable subscribe = HttpClient.Builder.getWanAndroidServer().getWxarticleDetail(id, mPage).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<BaseResultBean<WxarticleDetailItemBean>>() {
@Override
public void accept(BaseResultBean<WxarticleDetailItemBean> naviJsonBean) throws Exception {
if (naviJsonBean != null && naviJsonBean.getData() != null && naviJsonBean.getData().getDatas() != null && naviJsonBean.getData().getDatas().size() > 0) {
// detail
data.setValue(naviJsonBean.getData().getDatas());
} else {
data.setValue(null);
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
data.setValue(null);
}
});
addDisposable(subscribe);
}
Aggregations