| | |
| | | Map<String, Object> map = paramsInit(paramsMap);
|
| | | JsonObject jsonResult = null;
|
| | | if (CONST.isHdlServer()) {
|
| | | jsonResult = doPost(CONST.HOST + "/home-wisdom/imou/openapi/" + method, map, timeOut);
|
| | | if(method.equals("bindDevice")){
|
| | | jsonResult = doPost(CONST.HOST + "/home-wisdom/app/device/independentRegister", map, timeOut);
|
| | | }else {
|
| | | jsonResult = doPost(CONST.HOST + "/home-wisdom/imou/openapi/" + method, map, timeOut);
|
| | | }
|
| | | } else {
|
| | | jsonResult = doPost(CONST.HOST + "/openapi/" + method, map, timeOut);
|
| | | if (jsonResult == null) {
|
| | |
| | |
|
| | | private static JsonObject doPost(String url, Map<String, Object> map, int timeOut) throws BusinessException {
|
| | | Gson gson = new Gson();
|
| | | map.put("homeId", LCDeviceEngine.newInstance().getHomeId());
|
| | | String json;
|
| | | JsonObject jsonObject;
|
| | | if(CONST.isHdlServer()) {
|
| | | map.put("homeId", LCDeviceEngine.newInstance().getHomeId());
|
| | | if (map.containsKey("params")) {
|
| | | Map<String, Object> tempMap = (Map<String, Object>) map.get("params");
|
| | | map.remove("params");
|