| | |
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.create.get", map);
|
| | | 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;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.change.get", map);
|
| | | 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;
|