From f70ae457afcfb1bdd788eab9f5abf535f7d4c0c9 Mon Sep 17 00:00:00 2001 From: heavyrain2012 Date: Sat, 16 Jan 2021 09:13:53 +0800 Subject: [PATCH] add robot callback api --- .../java/cn/wildfirechat/common/APIPath.java | 4 ++++ .../wildfirechat/pojos/RobotCallbackPojo.java | 21 +++++++++++++++++++ .../cn/wildfirechat/sdk/RobotService.java | 12 +++++++++++ 3 files changed, 37 insertions(+) create mode 100755 common/src/main/java/cn/wildfirechat/pojos/RobotCallbackPojo.java diff --git a/common/src/main/java/cn/wildfirechat/common/APIPath.java b/common/src/main/java/cn/wildfirechat/common/APIPath.java index f41134c3..b41d0a3b 100644 --- a/common/src/main/java/cn/wildfirechat/common/APIPath.java +++ b/common/src/main/java/cn/wildfirechat/common/APIPath.java @@ -76,6 +76,10 @@ public interface APIPath { String Robot_User_Info = "/robot/user_info"; String Robot_Message_Send = "/robot/message/send"; + + String Robot_Set_Callback = "/robot/set_callback"; + String Robot_Delete_Callback = "/robot/delete_callback"; + String Robot_Verify_Application_User = "/robot/user/verify"; String Robot_Group_Member_Add = "/robot/group/member/add"; diff --git a/common/src/main/java/cn/wildfirechat/pojos/RobotCallbackPojo.java b/common/src/main/java/cn/wildfirechat/pojos/RobotCallbackPojo.java new file mode 100755 index 00000000..6d9b3efb --- /dev/null +++ b/common/src/main/java/cn/wildfirechat/pojos/RobotCallbackPojo.java @@ -0,0 +1,21 @@ +/* + * This file is part of the Wildfire Chat package. + * (c) Heavyrain2012 + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +package cn.wildfirechat.pojos; + +public class RobotCallbackPojo { + private String url; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/sdk/src/main/java/cn/wildfirechat/sdk/RobotService.java b/sdk/src/main/java/cn/wildfirechat/sdk/RobotService.java index c9961d85..8918b655 100644 --- a/sdk/src/main/java/cn/wildfirechat/sdk/RobotService.java +++ b/sdk/src/main/java/cn/wildfirechat/sdk/RobotService.java @@ -36,6 +36,18 @@ public class RobotService { return RobotHttpUtils.httpJsonPost(path, getUserInfo, InputOutputUserInfo.class); } + public static IMResult setCallback(String url) throws Exception { + String path = APIPath.Robot_Set_Callback; + RobotCallbackPojo pojo = new RobotCallbackPojo(); + pojo.setUrl(url); + return RobotHttpUtils.httpJsonPost(path, pojo, Void.class); + } + + public static IMResult getCallback() throws Exception { + String path = APIPath.Robot_Set_Callback; + return RobotHttpUtils.httpJsonPost(path, null, RobotCallbackPojo.class); + } + public static IMResult createGroup(PojoGroupInfo group_info, List members, List to_lines, MessagePayload notify_message) throws Exception { String path = APIPath.Robot_Create_Group; PojoGroup pojoGroup = new PojoGroup();