| | |
| | | import com.google.gson.JsonObject;
|
| | | import com.google.gson.JsonParser;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import hdl.onpro.HdlData;
|
| | | import com.mm.android.deviceaddmodule.LCDeviceEngine;
|
| | | import com.mm.android.deviceaddmodule.mobilecommon.AppConsume.BusinessException;
|
| | | import com.mm.android.deviceaddmodule.mobilecommon.utils.LogUtil;
|
| | | import com.mm.android.deviceaddmodule.mobilecommon.utils.MD5Helper;
|
| | |
|
| | | import org.apache.http.conn.ConnectTimeoutException;
|
| | | import org.greenrobot.eventbus.EventBus;
|
| | | import org.json.JSONObject;
|
| | |
|
| | | import java.io.IOException;
|
| | |
| | | if (!"0".equals(code)) {
|
| | | try {
|
| | | String msg = jsonResult.get("msg").getAsString();
|
| | | if (method.equals("bindDevice")) {
|
| | | Intent intent = new Intent();
|
| | | intent.setAction("hdlUserDeviceBind");
|
| | | intent.putExtra("data", jsonResult.toString());
|
| | | LCDeviceEngine.newInstance().getContext().sendBroadcast(intent);
|
| | | }
|
| | | EventBus.getDefault().post("InterfaceException");
|
| | | hdl.onpro.HdlData.getInstance().getiRegisterDeviceFeedback().feedback(method,jsonResult.toString());
|
| | | throw new BusinessException(code + msg);
|
| | | }catch (Exception exception){
|
| | | String msg = jsonResult.get("message").getAsString();
|
| | | if (method.equals("bindDevice")) {
|
| | | Intent intent = new Intent();
|
| | | intent.setAction("hdlUserDeviceBind");
|
| | | intent.putExtra("data", jsonResult.toString());
|
| | | LCDeviceEngine.newInstance().getContext().sendBroadcast(intent);
|
| | | }
|
| | | EventBus.getDefault().post("InterfaceException");
|
| | | hdl.onpro.HdlData.getInstance().getiRegisterDeviceFeedback().feedback(method,jsonResult.toString());
|
| | | throw new BusinessException(code + msg);
|
| | | }
|
| | | }
|