use of com.dante.data.model.BaseResult in project 91Pop by DanteAndroid.
the class AppApiHelper method loadPorn91VideoByCategory.
@Override
public Observable<BaseResult<List<UnLimit91PornItem>>> loadPorn91VideoByCategory(String category, String viewType, int page, String m, boolean cleanCache, boolean isLoadMoreCleanCache) {
// RxCache条件区别
String condition;
if (TextUtils.isEmpty(m)) {
condition = category;
} else {
condition = category + m;
}
DynamicKeyGroup dynamicKeyGroup = new DynamicKeyGroup(condition, page);
EvictDynamicKey evictDynamicKey = new EvictDynamicKey(cleanCache || isLoadMoreCleanCache);
Observable<String> categoryPage = noLimit91PornServiceApi.getCategoryPage(category, viewType, page, m, HeaderUtils.getIndexHeader(addressHelper));
return cacheProviders.getCategoryPage(categoryPage, dynamicKeyGroup, evictDynamicKey).map(new Function<Reply<String>, String>() {
@Override
public String apply(Reply<String> responseBody) throws Exception {
return responseBody.getData();
}
}).map(new Function<String, BaseResult<List<UnLimit91PornItem>>>() {
@Override
public BaseResult<List<UnLimit91PornItem>> apply(String s) throws Exception {
return Parse91PronVideo.parseHot(s);
}
});
}
use of com.dante.data.model.BaseResult in project 91Pop by DanteAndroid.
the class AppApiHelper method loadPorn91authorVideos.
@Override
public Observable<BaseResult<List<UnLimit91PornItem>>> loadPorn91authorVideos(String uid, String type, int page, boolean cleanCache) {
// RxCache条件区别
String condition = null;
if (!TextUtils.isEmpty(uid)) {
condition = uid;
}
DynamicKeyGroup dynamicKeyGroup = new DynamicKeyGroup(condition, page);
EvictDynamicKey evictDynamicKey = new EvictDynamicKey(cleanCache);
Observable<String> stringObservable = noLimit91PornServiceApi.authorVideos(uid, type, page);
return cacheProviders.authorVideos(stringObservable, dynamicKeyGroup, evictDynamicKey).map(new Function<Reply<String>, String>() {
@Override
public String apply(Reply<String> responseBody) throws Exception {
return responseBody.getData();
}
}).map(new Function<String, BaseResult<List<UnLimit91PornItem>>>() {
@Override
public BaseResult<List<UnLimit91PornItem>> apply(String s) throws Exception {
return Parse91PronVideo.parseAuthorVideos(s);
}
});
}
Aggregations