部分接口修改
This commit is contained in:
@ -8,6 +8,7 @@ import android.view.View;
|
||||
|
||||
import com.gh.common.util.AskLogUtils;
|
||||
import com.gh.common.util.CheckLoginUtils;
|
||||
import com.gh.common.util.UrlFilterUtils;
|
||||
import com.gh.gamecenter.QuestionEditActivity;
|
||||
import com.gh.gamecenter.QuestionsDetailActivity;
|
||||
import com.gh.gamecenter.R;
|
||||
@ -81,7 +82,7 @@ public class AskQuestionsNewBodyFragment extends ListFragment<Questions, NormalL
|
||||
|
||||
@Override
|
||||
public Observable<List<Questions>> provideDataObservable(int page) {
|
||||
return RetrofitManager.getInstance(getContext()).getApi().getAskQuestions(mCommunityId, mType, page);
|
||||
return RetrofitManager.getInstance(getContext()).getApi().getAskQuestions(mCommunityId, UrlFilterUtils.getFilterQuery("tag_group", mType), page);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -89,7 +89,7 @@ public class AskQuestionsRecommendsViewModel extends ListViewModel<AnswerEntity,
|
||||
@Override
|
||||
public void onResponse(List<AnswerEntity> response) {
|
||||
loadStatusControl(response.size(), sequenceId, isUp);
|
||||
if (response.size() == 0) return; // 不需要添加 页面由LoadStatus控制刷新
|
||||
// if (response.size() == 0) return; // 不需要添加 页面由LoadStatus控制刷新
|
||||
|
||||
List<AnswerEntity> previousData = mLiveData.getValue();
|
||||
if (previousData == null || TextUtils.isEmpty(sequenceId)) {
|
||||
|
||||
@ -62,7 +62,7 @@ public class ListRepository<LD> {
|
||||
public void onResponse(List<LD> response) {
|
||||
loadStatusControl(response.size());
|
||||
|
||||
if (response.size() == 0) return; // 不需要添加 页面由LoadStatus控制刷新
|
||||
// if (response.size() == 0) return; // 不需要添加 页面由LoadStatus控制刷新
|
||||
|
||||
List<LD> previousData = mResultLiveData.getValue();
|
||||
if (previousData == null || curStatus == LoadStatus.INIT) {
|
||||
|
||||
@ -202,6 +202,6 @@ class OriginalAdapter extends ListAdapter<NewsEntity> {
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mEntityList == null ? 0 : mEntityList.size() + FOOTER_ITEM_COUNT;
|
||||
return mEntityList == null || mEntityList.isEmpty() ? 0 : mEntityList.size() + FOOTER_ITEM_COUNT;
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ class StrategyAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
isLoading = true;
|
||||
RetrofitManager.getInstance(mContext)
|
||||
.getApi()
|
||||
.getNews("攻略", 20, mPage)
|
||||
.getStrategy(mPage)
|
||||
.map(new Func1<List<NewsEntity>, List<NewsEntity>>() {
|
||||
@Override
|
||||
public List<NewsEntity> call(List<NewsEntity> newsEntities) {
|
||||
|
||||
@ -19,6 +19,7 @@ import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.DownloadItemUtils;
|
||||
import com.gh.common.util.KaiFuUtils;
|
||||
import com.gh.common.util.StringUtils;
|
||||
import com.gh.common.util.UrlFilterUtils;
|
||||
import com.gh.download.DownloadManager;
|
||||
import com.gh.gamecenter.GameDetailActivity;
|
||||
import com.gh.gamecenter.R;
|
||||
@ -82,7 +83,7 @@ public class KaiFuVpAdapter extends BaseRecyclerAdapter {
|
||||
public void addList() {
|
||||
mIsLoaded = false;
|
||||
RetrofitManager.getInstance(mContext).getApi()
|
||||
.getKaiFuData(mGameId, mDay, mPage, 20)
|
||||
.getKaiFuData(UrlFilterUtils.getFilterQuery("game_id", mGameId, "day", mDay), mPage, 20)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Response<List<GameEntity>>() {
|
||||
|
||||
@ -81,9 +81,8 @@ public interface ApiService {
|
||||
/**
|
||||
* 获取资讯-攻略
|
||||
*/
|
||||
@GET("articles")
|
||||
Observable<List<NewsEntity>> getNews(@Query("type_group") String type_group,
|
||||
@Query("limit") int limit, @Query("page") int page);
|
||||
@GET("articles?filter=type_group:攻略&view=digest")
|
||||
Observable<List<NewsEntity>> getStrategy(@Query("page") int page);
|
||||
|
||||
/**
|
||||
* 获取游戏摘要
|
||||
@ -106,7 +105,7 @@ public interface ApiService {
|
||||
/**
|
||||
* 获取热门卡牌
|
||||
*/
|
||||
@GET("game/remenkapai")
|
||||
@GET("columns/5ac46cca2924bc2870438d28/games")
|
||||
Observable<List<GameEntity>> getRemenkapai();
|
||||
|
||||
/**
|
||||
@ -205,9 +204,8 @@ public interface ApiService {
|
||||
/**
|
||||
* 搜索新闻
|
||||
*/
|
||||
@GET("articles:search")
|
||||
Observable<List<NewsEntity>> getSearchNews(@Query("game_id") String game_id, @Query("keyword") String keyword,
|
||||
@Query("page") int page, @Query("limit") int limit);
|
||||
@GET()
|
||||
Observable<List<NewsEntity>> getSearchNews(@Url String url);
|
||||
|
||||
/**
|
||||
* 搜索游戏
|
||||
@ -238,8 +236,7 @@ public interface ApiService {
|
||||
* 获取专题数据
|
||||
*/
|
||||
@GET("columns/{column_id}/games")
|
||||
Observable<List<GameEntity>> getColumn(@Path("column_id") String column_id, @Query("order") String order,
|
||||
@Query("page") int page, @Query("type") String type);
|
||||
Observable<List<GameEntity>> getColumn(@Path("column_id") String column_id, @Query("filter") String order, @Query("page") int page);
|
||||
|
||||
/**
|
||||
* 获取专题数据标题
|
||||
@ -278,11 +275,6 @@ public interface ApiService {
|
||||
@GET("packages?page_size=5000")
|
||||
Observable<List<PackageEntity>> getPackageUsed(@Query("filter") String filter, @Query("skip") long skip);
|
||||
|
||||
/**
|
||||
* 获取设备关注数据 针对助手2.3版本关注数据的迁移
|
||||
*/
|
||||
@GET("device/{device_id}/concern")
|
||||
Observable<List<String>> getConcernData(@Path("device_id") String device_id);
|
||||
|
||||
/**
|
||||
* 根据专题ID获取专题名称
|
||||
@ -306,8 +298,7 @@ public interface ApiService {
|
||||
* 获取开服表数据
|
||||
*/
|
||||
@GET("games/servers")
|
||||
Observable<List<GameEntity>> getKaiFuData(@Query("type") String type, @Query("day") String day,
|
||||
@Query("page") int page, @Query("limit") int limit);
|
||||
Observable<List<GameEntity>> getKaiFuData(@Query("filter") String type, @Query("page") int page, @Query("limit") int limit);
|
||||
|
||||
/**
|
||||
* 获取游戏新闻类型
|
||||
@ -349,18 +340,6 @@ public interface ApiService {
|
||||
Observable<List<ToolBoxEntity>> getToolKitData(@Query("page") int page, @Query("filter") String filter);
|
||||
|
||||
|
||||
/**
|
||||
* 获取已关注的工具箱数据
|
||||
*/
|
||||
@GET("users/{user_id}/follows/toolkits")
|
||||
Observable<List<ToolBoxEntity>> getConcernToolKitData(@Path("user_id") String user_id, @Query("page") int page, @Query("keyword") String keyword);
|
||||
|
||||
/**
|
||||
* 根据工具箱id获取工具箱详情数据
|
||||
*/
|
||||
@GET("toolkit")
|
||||
Observable<List<ToolBoxEntity>> getToolBoxById(@Query("id") String toolsId);
|
||||
|
||||
/**
|
||||
* 增加收藏的工具
|
||||
*/
|
||||
@ -397,18 +376,6 @@ public interface ApiService {
|
||||
@DELETE("users/{user_id}/favorites/articles/{article_id}")
|
||||
Observable<ResponseBody> deletaCollectionArticle(@Path("user_id") String user_id, @Path("article_id") String article_id);
|
||||
|
||||
// /**
|
||||
// * 修改收藏的文章
|
||||
// */
|
||||
// @POST("favorite/toolkit/{toolsid}")
|
||||
// Observable<ResponseBody> patchCollectionTools(@Path("toolsid") String toolsId);
|
||||
|
||||
/**/
|
||||
// * 修改收藏的工具
|
||||
// */
|
||||
// @POST("favorite/article/{articleid}")
|
||||
// Observable<ResponseBody> patchCollectionArticle(@Path("articleid") String articleId);
|
||||
|
||||
/**
|
||||
* 根据设备信息判断用户是否是新用户
|
||||
*/
|
||||
@ -703,7 +670,7 @@ public interface ApiService {
|
||||
* 获取社区首页-问题列表
|
||||
*/
|
||||
@GET("communities/{community_id}/questions?view=digest")
|
||||
Observable<List<Questions>> getAskQuestions(@Path("community_id") String communityId, @Query("tag_group") String type, @Query("page") int page);
|
||||
Observable<List<Questions>> getAskQuestions(@Path("community_id") String communityId, @Query("filter") String filter, @Query("page") int page);
|
||||
|
||||
/**
|
||||
* 获取社区首页栏目:默认
|
||||
|
||||
@ -20,6 +20,7 @@ import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.KaiFuUtils;
|
||||
import com.gh.common.util.NewsUtils;
|
||||
import com.gh.common.util.StringUtils;
|
||||
import com.gh.common.util.UrlFilterUtils;
|
||||
import com.gh.download.DownloadManager;
|
||||
import com.gh.gamecenter.GameDetailActivity;
|
||||
import com.gh.gamecenter.NewsDetailActivity;
|
||||
@ -93,7 +94,8 @@ class SubjectAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
public void initList(final int page) {
|
||||
|
||||
mIsLoaded = false;
|
||||
RetrofitManager.getInstance(mContext).getApi().getColumn(mId, mOrder, page, mType)
|
||||
RetrofitManager.getInstance(mContext).getApi().getColumn(mId
|
||||
, UrlFilterUtils.getFilterQuery("type", mType, "order", mOrder), page)
|
||||
.map(new Func1<List<GameEntity>, List<GameEntity>>() {
|
||||
@Override
|
||||
public List<GameEntity> call(List<GameEntity> list) {
|
||||
|
||||
@ -17,7 +17,9 @@ import com.gh.common.util.DataCollectionUtils;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
import com.gh.common.util.NewsUtils;
|
||||
import com.gh.common.util.UrlFilterUtils;
|
||||
import com.gh.common.view.VerticalItemDecoration;
|
||||
import com.gh.gamecenter.BuildConfig;
|
||||
import com.gh.gamecenter.NewsDetailActivity;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.adapter.viewholder.FooterViewHolder;
|
||||
@ -169,7 +171,9 @@ public class GameNewsSearchResultFragment extends NormalFragment {
|
||||
// DataUtils.onEvent(getContext(), "游戏新闻搜索", mSearchKey);
|
||||
// DataCollectionUtils.uploadSearch(getContext(), mSearchKey, "游戏新闻搜索");
|
||||
|
||||
RetrofitManager.getInstance(getContext()).getApi().getSearchNews(mGameId, mSearchKey, page, 20)
|
||||
RetrofitManager.getInstance(getContext()).getApi()
|
||||
.getSearchNews(BuildConfig.API_HOST + "articles:search?view=digest&filter="
|
||||
+ UrlFilterUtils.getFilterQuery("game_id", mGameId, "keyword", mSearchKey) + "&page=" + String.valueOf(mPage))
|
||||
.map(new Func1<List<NewsEntity>, List<NewsEntity>>() {
|
||||
@Override
|
||||
public List<NewsEntity> call(List<NewsEntity> list) {
|
||||
|
||||
Reference in New Issue
Block a user