@@ -105,7 +105,7 @@ public class BriefsPresenter implements BriefsContract.Presenter,BaseInteractor. |
||
| 105 | 105 |
} |
| 106 | 106 |
|
| 107 | 107 |
@Override |
| 108 |
- public void onBoxStatusFetched(String boxNo, String boxStatus, String boxStatusCode) {
|
|
| 108 |
+ public void onBoxStatusFetched(String boxNo, String boxStatus, int boxStatusCode) {
|
|
| 109 | 109 |
briefsView.updateBoxInfo(boxNo,boxStatus+"("+boxStatusCode+")");
|
| 110 | 110 |
} |
| 111 | 111 |
|
@@ -224,8 +224,8 @@ class MainPresenter implements MainContract.Presenter,BaseInteractor.InteractorL |
||
| 224 | 224 |
|
| 225 | 225 |
|
| 226 | 226 |
@Override |
| 227 |
- public void onBoxStatusFetched(String boxNo, String boxStatus, String boxStatusCode) {
|
|
| 228 |
- if("200".equals(boxStatusCode)){
|
|
| 227 |
+ public void onBoxStatusFetched(String boxNo, String boxStatus, int boxStatusCode) {
|
|
| 228 |
+ if(200 == boxStatusCode){
|
|
| 229 | 229 |
isBoxConnected = true; |
| 230 | 230 |
view.showBoxConnectedView(); |
| 231 | 231 |
}else{
|
@@ -7,9 +7,11 @@ import com.android.common.executors.ThreadExecutor; |
||
| 7 | 7 |
|
| 8 | 8 |
import org.json.JSONObject; |
| 9 | 9 |
|
| 10 |
+import java.util.Random; |
|
| 10 | 11 |
import java.util.Timer; |
| 11 | 12 |
import java.util.TimerTask; |
| 12 | 13 |
|
| 14 |
+import ai.pai.lensman.BuildConfig; |
|
| 13 | 15 |
import ai.pai.lensman.base.BaseInteractor; |
| 14 | 16 |
import ai.pai.lensman.utils.BoxUrlContainer; |
| 15 | 17 |
import ai.pai.lensman.utils.HttpPostTask; |
@@ -65,6 +67,12 @@ public class QueryBoxStatusInteractor implements BaseInteractor{
|
||
| 65 | 67 |
@Override |
| 66 | 68 |
protected void onPostFail() {
|
| 67 | 69 |
super.onPostFail(); |
| 70 |
+ if(BuildConfig.isTestMode){
|
|
| 71 |
+ if(listener!=null){
|
|
| 72 |
+ listener.onBoxStatusFetched("123","状态消息",100*new Random().nextInt(3)+new Random().nextInt(3));
|
|
| 73 |
+ } |
|
| 74 |
+ return; |
|
| 75 |
+ } |
|
| 68 | 76 |
} |
| 69 | 77 |
|
| 70 | 78 |
@Override |