| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.JsonElement;
|
| | | import com.google.gson.JsonObject;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.mm.android.deviceaddmodule.LCDeviceEngine;
|
| | | import com.mm.android.deviceaddmodule.device_wifi.CurWifiInfo;
|
| | | import com.mm.android.deviceaddmodule.device_wifi.WifiConfig;
|
| | |
| | | import org.json.JSONObject;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | public class DeviceAddOpenApiManager {
|
| | | private static int TIME_OUT = 10 * 1000;
|
| | |
| | | return json.get("openid").getAsString();
|
| | | }
|
| | |
|
| | | public static boolean addPolicy(AddDevicePolicyData req)throws BusinessException{
|
| | | String jsonParam = new Gson().toJson(req);
|
| | | HttpSend.execute(jsonParam, CONST.ADD_POLICY,TIME_OUT);
|
| | | return true;
|
| | | public static boolean addPolicy(AddDevicePolicyData req)throws BusinessException {
|
| | | // String jsonParam = new Gson().toJson(req);
|
| | | // HttpSend.execute(jsonParam, CONST.ADD_POLICY,TIME_OUT);
|
| | | // return true;
|
| | |
|
| | | final Map<String, Object> map = new Gson().fromJson(new Gson().toJson(req), new TypeToken<Map<String, String>>() {
|
| | | }.getType());
|
| | |
|
| | | JsonObject json = HttpSend.execute(map, CONST.CREATE_SUB_ACCOUNT, TIME_OUT);
|
| | | return true;
|
| | | }
|
| | | }
|