本文整理汇总了Java中com.justwayward.reader.bean.Rankings类的典型用法代码示例。如果您正苦于以下问题:Java Rankings类的具体用法?Java Rankings怎么用?Java Rankings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Rankings类属于com.justwayward.reader.bean包,在下文中一共展示了Rankings类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRankList
import com.justwayward.reader.bean.Rankings; //导入依赖的package包/类
@Override
public void getRankList(String id) {
Subscription rxSubscription = bookApi.getRanking(id).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Rankings>() {
@Override
public void onCompleted() {
mView.complete();
}
@Override
public void onError(Throwable e) {
LogUtils.e("getRankList:" + e.toString());
mView.showError();
}
@Override
public void onNext(Rankings ranking) {
List<Rankings.RankingBean.BooksBean> books = ranking.ranking.books;
BooksByCats cats = new BooksByCats();
cats.books = new ArrayList<>();
for (Rankings.RankingBean.BooksBean bean : books) {
cats.books.add(new BooksByCats.BooksBean(bean._id, bean.cover, bean.title, bean.author, bean.cat, bean.shortIntro, bean.latelyFollower, bean.retentionRatio));
}
mView.showRankList(cats);
}
});
addSubscrebe(rxSubscription);
}
示例2: getRanking
import com.justwayward.reader.bean.Rankings; //导入依赖的package包/类
public Observable<Rankings> getRanking(String rankingId) {
return service.getRanking(rankingId);
}
示例3: getRanking
import com.justwayward.reader.bean.Rankings; //导入依赖的package包/类
/**
* 获取单一排行榜
* 周榜:rankingId->_id
* 月榜:rankingId->monthRank
* 总榜:rankingId->totalRank
*
* @return
*/
@GET("/ranking/{rankingId}")
Observable<Rankings> getRanking(@Path("rankingId") String rankingId);