fix apiservice
This commit is contained in:
@ -49,6 +49,7 @@ import rx.functions.Action1;
|
||||
import rx.functions.Func1;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
|
||||
/**
|
||||
* Created by khy on 18/07/17.
|
||||
*/
|
||||
@ -75,7 +76,7 @@ public class ArticleAdapter extends BaseRecyclerAdapter {
|
||||
return;
|
||||
}
|
||||
isLoading = true;
|
||||
RetrofitManager
|
||||
RetrofitManager.getInstance(mContext)
|
||||
.getApi()
|
||||
.getCollectionArticle(LoginUtils.getToken(mContext), offset)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@ -154,7 +155,7 @@ public class ArticleAdapter extends BaseRecyclerAdapter {
|
||||
}, new Action1<String>() {
|
||||
@Override
|
||||
public void call(String ids) {
|
||||
RetrofitManager.getData()
|
||||
RetrofitManager.getInstance(mContext).getData()
|
||||
.getNewsViews(ids)
|
||||
.map(new Func1<List<ViewsEntity>, String>() {
|
||||
@Override
|
||||
@ -384,7 +385,7 @@ public class ArticleAdapter extends BaseRecyclerAdapter {
|
||||
|
||||
// 统计新闻阅读量
|
||||
private void statNewsViews(final NewsEntity newsEntity, final int position) {
|
||||
RetrofitManager.getData().postNewsViews(newsEntity.getId())
|
||||
RetrofitManager.getInstance(mContext).getData().postNewsViews(newsEntity.getId())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new JSONObjectResponse() {
|
||||
|
||||
Reference in New Issue
Block a user