| | |
| | |
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.create.get", map);
|
| | | |
| | | // String result = "{\r\n" + |
| | | // " \"status\":\"0000\",\r\n" + |
| | | // " \"msg\":\"亲,添加成功\",\r\n" + |
| | | // " \"data\":{\r\n" + |
| | | // " \"id\":11770,\r\n" + |
| | | // " \"uid\":1625,\r\n" + |
| | | // " \"wechatrobot\":\"wechatrobot\",\r\n" + |
| | | // " \"wx_id\":\"\",\r\n" + |
| | | // " \"amount_used\":0,\r\n" + |
| | | // " \"group_num\":20,\r\n" + |
| | | // " \"passwd\":\"\",\r\n" + |
| | | // " \"nickname\":\"\",\r\n" + |
| | | // " \"c_uid\":1625,\r\n" + |
| | | // " \"login_status\":0,\r\n" + |
| | | // " \"end_time\":1594785534,\r\n" + |
| | | // " \"remark\":null,\r\n" + |
| | | // " \"wc_id\":\"\",\r\n" + |
| | | // " \"agent_uid\":null,\r\n" + |
| | | // " \"is_enabled\":0,\r\n" + |
| | | // " \"robot_type\":4,\r\n" + |
| | | // " \"ip\":\"http://49.234.36.129:10002/\",\r\n" + |
| | | // " \"is_new\":1\r\n" + |
| | | // " }\r\n" + |
| | | // "}\r\n" + |
| | | // "";
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | |
| | | if ("0000".equals(resultJson.optString("status"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | Type type = new TypeToken<RobotInfoDTO>() {}.getType();
|
| | | return new Gson().fromJson(resultJson.toString(), type);
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 机器人更换微信号
|
| | | * @param robotId 机器人id
|
| | | * @param wxid 微信号
|
| | | * @return
|
| | | */
|
| | | public static RobotInfoDTO robotChangeWeiXin(int robotId, String wxid) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("wechatrobot", wxid);
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.change.get", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | Type type = new TypeToken<RobotInfoDTO>() {}.getType();
|
| | | return new Gson().fromJson(resultJson.toString(), type);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | map.put("month", month +"");
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.change.get", map);
|
| | | |
| | | // String result = "{\r\n" + |
| | | // " \"status\":\"0000\",\r\n" + |
| | | // " \"msg\":\"\\u4eb2,\\u6dfb\\u52a0\\u6210\\u529f\",\r\n" + |
| | | // " \"data\":{\r\n" + |
| | | // " \"id\":11770,\r\n" + |
| | | // " \"uid\":1625,\r\n" + |
| | | // " \"wechatrobot\":\"fxdaka\",\r\n" + |
| | | // " \"wx_id\":\"wxid_vm6eb5i0in0622\",\r\n" + |
| | | // " \"amount_used\":0,\r\n" + |
| | | // " \"group_num\":20,\r\n" + |
| | | // " \"passwd\":\"\",\r\n" + |
| | | // " \"nickname\":\"\\u5206\\u4eab\\u5927\\u5496??\",\r\n" + |
| | | // " \"c_uid\":1625,\r\n" + |
| | | // " \"login_status\":1,\r\n" + |
| | | // " \"end_time\":1597377534,\r\n" + |
| | | // " \"remark\":null,\r\n" + |
| | | // " \"wc_id\":\"246124e9-9a8c-4da6-a77e-7f7f88049731\",\r\n" + |
| | | // " \"agent_uid\":null,\r\n" + |
| | | // " \"is_enabled\":0,\r\n" + |
| | | // " \"robot_type\":4,\r\n" + |
| | | // " \"ip\":\"http:\\/\\/49.234.36.129:10002\\/\",\r\n" + |
| | | // " \"is_new\":1\r\n" + |
| | | // " }\r\n" + |
| | | // "}";
|
| | | // |
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | if ("0000".equals(resultJson.optString("status"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | Type type = new TypeToken<RobotInfoDTO>() {}.getType();
|
| | | return new Gson().fromJson(resultJson.toString(), type);
|
| | |
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.delete.get", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | if ("0000".equals(resultJson.optString("status"))) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | |
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.macsend.videocircle", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("1000".equals(resultJson.optString("code"))) {
|
| | | if ("0000".equals(resultJson.optString("status"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | return resultJson.optString("id");
|
| | | if (resultJson != null) {
|
| | | resultJson = resultJson.optJSONObject("object");
|
| | | if (resultJson != null) {
|
| | | return resultJson.optString("id");
|
| | | }
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.macsend.base64", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if (resultJson.optInt("code") == 1000) {
|
| | | if ("0000".equals(resultJson.optString("status"))) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | |
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.macsend.card", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if (resultJson.optInt("code") == 1000) {
|
| | | if ("0000".equals(resultJson.optString("status"))) {
|
| | | return true;
|
| | | }
|
| | | return false;
|