Commit 15f895b08d5e6a9628820b0c7f80bb531f37fea4
1 parent
ce07866a
修改及测试接口
Showing
5 changed files
with
7 additions
and
14 deletions
app/src/main/java/com/cnlive/gundam/main/application/CNLiveApplication.java
| @@ -14,7 +14,7 @@ public class CNLiveApplication extends Application { | @@ -14,7 +14,7 @@ public class CNLiveApplication extends Application { | ||
| 14 | public void onCreate() { | 14 | public void onCreate() { |
| 15 | super.onCreate(); | 15 | super.onCreate(); |
| 16 | //TODO 测试ID 在正式与测试环境均可通过,正式ID则不行~! | 16 | //TODO 测试ID 在正式与测试环境均可通过,正式ID则不行~! |
| 17 | -// Config.init(getApplicationContext(), "60_j4fc7dsm83", "4c8658abc5d66f270f9bf5dcd1ef11e3597fab4c4e0af9",true); | ||
| 18 | - Config.init(getApplicationContext(), "60_j4faozoq85", "7b6da5a6e2955aaf7f73a06b5bdc6d50e6d5bfda3da86b"); | 17 | + Config.init(getApplicationContext(), "60_j4fc7dsm83", "4c8658abc5d66f270f9bf5dcd1ef11e3597fab4c4e0af9",true); |
| 18 | +// Config.init(getApplicationContext(), "60_j4faozoq85", "7b6da5a6e2955aaf7f73a06b5bdc6d50e6d5bfda3da86b"); | ||
| 19 | } | 19 | } |
| 20 | } | 20 | } |
app/src/main/java/com/cnlive/gundam/main/model/ActivePlayInfo.java
| @@ -35,7 +35,6 @@ public class ActivePlayInfo extends ErrorMessage { | @@ -35,7 +35,6 @@ public class ActivePlayInfo extends ErrorMessage { | ||
| 35 | private String endTime; | 35 | private String endTime; |
| 36 | private String coverImgUrl; | 36 | private String coverImgUrl; |
| 37 | private String activityCategory; | 37 | private String activityCategory; |
| 38 | - private String extensions; | ||
| 39 | private String rates; | 38 | private String rates; |
| 40 | private String extViews; | 39 | private String extViews; |
| 41 | 40 | ||
| @@ -122,14 +121,6 @@ public class ActivePlayInfo extends ErrorMessage { | @@ -122,14 +121,6 @@ public class ActivePlayInfo extends ErrorMessage { | ||
| 122 | this.activityCategory = activityCategory; | 121 | this.activityCategory = activityCategory; |
| 123 | } | 122 | } |
| 124 | 123 | ||
| 125 | - public String getExtensions() { | ||
| 126 | - return extensions; | ||
| 127 | - } | ||
| 128 | - | ||
| 129 | - public void setExtensions(String extensions) { | ||
| 130 | - this.extensions = extensions; | ||
| 131 | - } | ||
| 132 | - | ||
| 133 | public String getRates() { | 124 | public String getRates() { |
| 134 | return rates; | 125 | return rates; |
| 135 | } | 126 | } |
| @@ -159,7 +150,6 @@ public class ActivePlayInfo extends ErrorMessage { | @@ -159,7 +150,6 @@ public class ActivePlayInfo extends ErrorMessage { | ||
| 159 | ", endTime='" + endTime + '\'' + | 150 | ", endTime='" + endTime + '\'' + |
| 160 | ", coverImgUrl='" + coverImgUrl + '\'' + | 151 | ", coverImgUrl='" + coverImgUrl + '\'' + |
| 161 | ", activityCategory='" + activityCategory + '\'' + | 152 | ", activityCategory='" + activityCategory + '\'' + |
| 162 | - ", extensions='" + extensions + '\'' + | ||
| 163 | ", rates='" + rates + '\'' + | 153 | ", rates='" + rates + '\'' + |
| 164 | ", extViews='" + extViews + '\'' + | 154 | ", extViews='" + extViews + '\'' + |
| 165 | '}'; | 155 | '}'; |
app/src/main/java/com/cnlive/gundam/main/network/ApiService.java
| @@ -9,6 +9,7 @@ import java.util.Map; | @@ -9,6 +9,7 @@ import java.util.Map; | ||
| 9 | 9 | ||
| 10 | import retrofit2.Call; | 10 | import retrofit2.Call; |
| 11 | import retrofit2.http.GET; | 11 | import retrofit2.http.GET; |
| 12 | +import retrofit2.http.POST; | ||
| 12 | import retrofit2.http.QueryMap; | 13 | import retrofit2.http.QueryMap; |
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| @@ -26,7 +27,7 @@ public interface ApiService { | @@ -26,7 +27,7 @@ public interface ApiService { | ||
| 26 | Call<ActivePlayInfo> getActivityPlayInfo(@QueryMap Map<String, String> options); | 27 | Call<ActivePlayInfo> getActivityPlayInfo(@QueryMap Map<String, String> options); |
| 27 | 28 | ||
| 28 | //判断活动的状态 | 29 | //判断活动的状态 |
| 29 | - @GET("vod_epg/getVodInfo4App") | 30 | + @POST("vod_epg/getVodListInfo4App") |
| 30 | Call<VodListPage> getVodInfoList(@QueryMap Map<String, String> options); | 31 | Call<VodListPage> getVodInfoList(@QueryMap Map<String, String> options); |
| 31 | 32 | ||
| 32 | //主播信息接口 | 33 | //主播信息接口 |
app/src/main/java/com/cnlive/gundam/main/ui/fragment/HomeFragment.java
| @@ -94,7 +94,7 @@ public class HomeFragment extends Fragment implements SwipeRefreshLayout.OnRefre | @@ -94,7 +94,7 @@ public class HomeFragment extends Fragment implements SwipeRefreshLayout.OnRefre | ||
| 94 | if (response.isSuccessful()) { | 94 | if (response.isSuccessful()) { |
| 95 | VodListPage model = response.body(); | 95 | VodListPage model = response.body(); |
| 96 | if (model != null && "0".equals(model.getCode())) { | 96 | if (model != null && "0".equals(model.getCode())) { |
| 97 | - if (model.getData() == null) { | 97 | + if (model.getData() == null || model.getData().size() <= 0) { |
| 98 | Toast.makeText(getActivity(), getString(R.string.request_null), Toast.LENGTH_LONG).show(); | 98 | Toast.makeText(getActivity(), getString(R.string.request_null), Toast.LENGTH_LONG).show(); |
| 99 | } else { | 99 | } else { |
| 100 | adapter.updateItems(model.getData()); | 100 | adapter.updateItems(model.getData()); |
app/src/main/java/com/cnlive/gundam/main/utils/ActivityJumpUtil.java
| @@ -2,6 +2,7 @@ package com.cnlive.gundam.main.utils; | @@ -2,6 +2,7 @@ package com.cnlive.gundam.main.utils; | ||
| 2 | 2 | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | +import android.util.Log; | ||
| 5 | import android.widget.Toast; | 6 | import android.widget.Toast; |
| 6 | 7 | ||
| 7 | import com.cnlive.gundam.R; | 8 | import com.cnlive.gundam.R; |
| @@ -49,6 +50,7 @@ public class ActivityJumpUtil { | @@ -49,6 +50,7 @@ public class ActivityJumpUtil { | ||
| 49 | 50 | ||
| 50 | @Override | 51 | @Override |
| 51 | public void onFailure(Call<ActivePlayInfo> call, Throwable t) { | 52 | public void onFailure(Call<ActivePlayInfo> call, Throwable t) { |
| 53 | + Log.e("11111111111111", "onFailure: "+call.request().toString() ); | ||
| 52 | Toast.makeText(context, context.getString(R.string.request_state_error), Toast.LENGTH_LONG).show(); | 54 | Toast.makeText(context, context.getString(R.string.request_state_error), Toast.LENGTH_LONG).show(); |
| 53 | } | 55 | } |
| 54 | }); | 56 | }); |