| | |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.hdl.hdlhttp.HxHttp; |
| | | import com.hdl.photovoltaic.bean.HttpResponsePack; |
| | | import com.hdl.photovoltaic.bean.LocalResponse; |
| | | import com.hdl.photovoltaic.config.AppConfigManage; |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.internet.HttpClient; |
| | |
| | | String requestUrl = TopicApi.GET_GATEWAY_OID_LIST; |
| | | TcpClient.getInstance().sendDataToLinkGateway(mac, requestUrl, null, "", new HDLLinkCallBack() { |
| | | @Override |
| | | public void onSuccess(String msg) { |
| | | public void onSuccess(String json) { |
| | | try { |
| | | if (!TextUtils.isEmpty(msg)) { |
| | | if (!TextUtils.isEmpty(json)) { |
| | | Gson gson = new Gson(); |
| | | String json = gson.toJson(msg); |
| | | LocalResponse localResponse = gson.fromJson(json, LocalResponse.class); |
| | | String objects = gson.toJson(localResponse.getObjects()); |
| | | Type typeOfT = new TypeToken<List<OidBean>>() { |
| | | }.getType(); |
| | | List<OidBean> list = gson.fromJson(json, typeOfT); |
| | | List<OidBean> list = gson.fromJson(objects, typeOfT); |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(list); |
| | | } |