Commit 15f895b08d5e6a9628820b0c7f80bb531f37fea4

Authored by 谷俊
1 parent ce07866a

修改及测试接口

app/src/main/java/com/cnlive/gundam/main/application/CNLiveApplication.java
... ... @@ -14,7 +14,7 @@ public class CNLiveApplication extends Application {
14 14 public void onCreate() {
15 15 super.onCreate();
16 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 35 private String endTime;
36 36 private String coverImgUrl;
37 37 private String activityCategory;
38   - private String extensions;
39 38 private String rates;
40 39 private String extViews;
41 40  
... ... @@ -122,14 +121,6 @@ public class ActivePlayInfo extends ErrorMessage {
122 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 124 public String getRates() {
134 125 return rates;
135 126 }
... ... @@ -159,7 +150,6 @@ public class ActivePlayInfo extends ErrorMessage {
159 150 ", endTime='" + endTime + '\'' +
160 151 ", coverImgUrl='" + coverImgUrl + '\'' +
161 152 ", activityCategory='" + activityCategory + '\'' +
162   - ", extensions='" + extensions + '\'' +
163 153 ", rates='" + rates + '\'' +
164 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 9  
10 10 import retrofit2.Call;
11 11 import retrofit2.http.GET;
  12 +import retrofit2.http.POST;
12 13 import retrofit2.http.QueryMap;
13 14  
14 15 /**
... ... @@ -26,7 +27,7 @@ public interface ApiService {
26 27 Call<ActivePlayInfo> getActivityPlayInfo(@QueryMap Map<String, String> options);
27 28  
28 29 //判断活动的状态
29   - @GET("vod_epg/getVodInfo4App")
  30 + @POST("vod_epg/getVodListInfo4App")
30 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 94 if (response.isSuccessful()) {
95 95 VodListPage model = response.body();
96 96 if (model != null && "0".equals(model.getCode())) {
97   - if (model.getData() == null) {
  97 + if (model.getData() == null || model.getData().size() <= 0) {
98 98 Toast.makeText(getActivity(), getString(R.string.request_null), Toast.LENGTH_LONG).show();
99 99 } else {
100 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 2  
3 3 import android.content.Context;
4 4 import android.content.Intent;
  5 +import android.util.Log;
5 6 import android.widget.Toast;
6 7  
7 8 import com.cnlive.gundam.R;
... ... @@ -49,6 +50,7 @@ public class ActivityJumpUtil {
49 50  
50 51 @Override
51 52 public void onFailure(Call<ActivePlayInfo> call, Throwable t) {
  53 + Log.e("11111111111111", "onFailure: "+call.request().toString() );
52 54 Toast.makeText(context, context.getString(R.string.request_state_error), Toast.LENGTH_LONG).show();
53 55 }
54 56 });
... ...