| | |
| | | import com.google.gson.JsonObject; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.hdl.hdlhttp.HxHttp; |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | | import com.hdl.photovoltaic.bean.HttpResponsePack; |
| | | import com.hdl.photovoltaic.internet.HttpClient; |
| | | import com.hdl.photovoltaic.internet.api.HttpApi; |
| | |
| | | json.addProperty("homeId", homeId); |
| | | json.addProperty("spk", spk); |
| | | json.addProperty("mac", mac); |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() { |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(HttpResponsePack httpResponsePack) { |
| | | public void onSuccess(String jsonStr) { |
| | | // if (httpResponsePack != null && httpResponsePack.getData() != null) { |
| | | // Gson gson = new Gson(); |
| | | // String json = gson.toJson(httpResponsePack.getData()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(Exception exception) { |
| | | public void onFailure(HDLException e) { |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onFailure(exception); |
| | | cloudCallBeak.onFailure(e); |
| | | } |
| | | } |
| | | }); |