2019-05-24 16:12:57 +08:00
|
|
|
package cn.wildfirechat.sdk;
|
|
|
|
|
|
|
|
|
|
import cn.wildfirechat.common.ErrorCode;
|
|
|
|
|
import cn.wildfirechat.pojos.*;
|
2019-05-25 13:53:51 +08:00
|
|
|
import cn.wildfirechat.proto.ProtoConstants;
|
2019-05-24 16:12:57 +08:00
|
|
|
import cn.wildfirechat.sdk.model.IMResult;
|
|
|
|
|
import cn.wildfirechat.sdk.utilities.AdminHttpUtils;
|
2019-05-25 13:53:51 +08:00
|
|
|
import cn.wildfirechat.sdk.utilities.RobotHttpUtils;
|
2019-05-24 16:12:57 +08:00
|
|
|
|
2019-07-06 21:52:05 +08:00
|
|
|
|
2019-05-24 21:08:31 +08:00
|
|
|
import java.util.ArrayList;
|
2019-05-25 13:53:51 +08:00
|
|
|
import java.util.Arrays;
|
2019-05-24 21:08:31 +08:00
|
|
|
import java.util.List;
|
|
|
|
|
|
2019-07-30 07:54:49 +08:00
|
|
|
import static cn.wildfirechat.proto.ProtoConstants.SystemSettingType.Group_Max_Member_Count;
|
|
|
|
|
|
2019-05-24 16:12:57 +08:00
|
|
|
public class Main {
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
2019-05-25 13:53:51 +08:00
|
|
|
//初始化服务API
|
2019-05-24 16:12:57 +08:00
|
|
|
AdminHttpUtils.init("http://localhost:18080", "123456");
|
|
|
|
|
|
2019-05-25 13:53:51 +08:00
|
|
|
//***********************************************
|
|
|
|
|
//**** 用户相关的API
|
|
|
|
|
//***********************************************
|
2019-05-24 16:12:57 +08:00
|
|
|
InputOutputUserInfo userInfo = new InputOutputUserInfo();
|
|
|
|
|
userInfo.setUserId("userId1");
|
|
|
|
|
userInfo.setName("user1");
|
|
|
|
|
userInfo.setMobile("13900000000");
|
|
|
|
|
userInfo.setDisplayName("user 1");
|
|
|
|
|
|
2019-07-06 21:52:05 +08:00
|
|
|
IMResult<OutputCreateUser> resultCreateUser = UserAdmin.createUser(userInfo);
|
2019-05-24 16:12:57 +08:00
|
|
|
if (resultCreateUser != null && resultCreateUser.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("Create user " + resultCreateUser.getResult().getName() + " success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("Create user failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-25 13:53:51 +08:00
|
|
|
InputCreateRobot createRobot = new InputCreateRobot();
|
|
|
|
|
createRobot.setUserId("robot1");
|
|
|
|
|
createRobot.setName("robot1");
|
|
|
|
|
createRobot.setDisplayName("机器人");
|
|
|
|
|
createRobot.setSecret("123456");
|
|
|
|
|
createRobot.setCallback("http://127.0.0.1:8883/robot/recvmsg");
|
|
|
|
|
IMResult<OutputCreateRobot> resultCreateRobot = UserAdmin.createRobot(createRobot);
|
|
|
|
|
if (resultCreateRobot != null && resultCreateRobot.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("Create robot " + resultCreateRobot.getResult().getUserId() + " success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("Create robot failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-24 16:12:57 +08:00
|
|
|
IMResult<InputOutputUserInfo> resultGetUserInfo1 = UserAdmin.getUserByName(userInfo.getName());
|
|
|
|
|
if (resultGetUserInfo1 != null && resultGetUserInfo1.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
if (userInfo.getUserId().equals(resultGetUserInfo1.getResult().getUserId())
|
|
|
|
|
&& userInfo.getName().equals(resultGetUserInfo1.getResult().getName())
|
|
|
|
|
&& userInfo.getMobile().equals(resultGetUserInfo1.getResult().getMobile())
|
|
|
|
|
&& userInfo.getDisplayName().equals(resultGetUserInfo1.getResult().getDisplayName())) {
|
|
|
|
|
System.out.println("get user info success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get user info by name failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get user info by name failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMResult<InputOutputUserInfo> resultGetUserInfo2 = UserAdmin.getUserByMobile(userInfo.getMobile());
|
|
|
|
|
if (resultGetUserInfo2 != null && resultGetUserInfo2.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
if (userInfo.getUserId().equals(resultGetUserInfo2.getResult().getUserId())
|
|
|
|
|
&& userInfo.getName().equals(resultGetUserInfo2.getResult().getName())
|
|
|
|
|
&& userInfo.getMobile().equals(resultGetUserInfo2.getResult().getMobile())
|
|
|
|
|
&& userInfo.getDisplayName().equals(resultGetUserInfo2.getResult().getDisplayName())) {
|
|
|
|
|
System.out.println("get user info success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get user info by mobile failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get user info by mobile failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMResult<InputOutputUserInfo> resultGetUserInfo3 = UserAdmin.getUserByUserId(userInfo.getUserId());
|
|
|
|
|
if (resultGetUserInfo3 != null && resultGetUserInfo3.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
if (userInfo.getUserId().equals(resultGetUserInfo3.getResult().getUserId())
|
|
|
|
|
&& userInfo.getName().equals(resultGetUserInfo3.getResult().getName())
|
|
|
|
|
&& userInfo.getMobile().equals(resultGetUserInfo3.getResult().getMobile())
|
|
|
|
|
&& userInfo.getDisplayName().equals(resultGetUserInfo3.getResult().getDisplayName())) {
|
|
|
|
|
System.out.println("get user info success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get user info by userId failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get user info by userId failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMResult<OutputGetIMTokenData> resultGetToken = UserAdmin.getUserToken(userInfo.getUserId(), "client111");
|
|
|
|
|
if (resultGetToken != null && resultGetToken.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("get token success: " + resultGetToken.getResult().getToken());
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get user token failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-21 12:18:38 +08:00
|
|
|
IMResult<Void> resultVoid =UserAdmin.updateUserBlockStatus(userInfo.getUserId(), 2);
|
2019-05-24 16:12:57 +08:00
|
|
|
if (resultVoid != null && resultVoid.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("block user done");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("block user failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMResult<OutputUserStatus> resultCheckUserStatus = UserAdmin.checkUserBlockStatus(userInfo.getUserId());
|
|
|
|
|
if (resultCheckUserStatus != null && resultCheckUserStatus.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
2019-07-21 12:18:38 +08:00
|
|
|
if (resultCheckUserStatus.getResult().getStatus() == 2) {
|
2019-05-24 16:12:57 +08:00
|
|
|
System.out.println("check user status success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("user status not correct");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("block user failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMResult<OutputUserBlockStatusList> resultBlockStatusList = UserAdmin.getBlockedList();
|
|
|
|
|
if (resultBlockStatusList != null && resultBlockStatusList.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
boolean success = false;
|
|
|
|
|
for (InputOutputUserBlockStatus blockStatus : resultBlockStatusList.getResult().getStatusList()) {
|
2019-07-21 12:18:38 +08:00
|
|
|
if (blockStatus.getUserId().equals(userInfo.getUserId()) && blockStatus.getStatus() == 2) {
|
2019-05-24 16:12:57 +08:00
|
|
|
System.out.println("get block list done");
|
|
|
|
|
success = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!success) {
|
|
|
|
|
System.out.println("block user status is not expected");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("block user failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-23 18:29:54 +08:00
|
|
|
resultVoid =UserAdmin.updateUserBlockStatus(userInfo.getUserId(), 0);
|
|
|
|
|
if (resultVoid != null && resultVoid.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("block user done");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("block user failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resultCheckUserStatus = UserAdmin.checkUserBlockStatus(userInfo.getUserId());
|
|
|
|
|
if (resultCheckUserStatus != null && resultCheckUserStatus.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
if (resultCheckUserStatus.getResult().getStatus() == 0) {
|
|
|
|
|
System.out.println("check user status success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("user status not correct");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("block user failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
2019-05-24 21:08:31 +08:00
|
|
|
|
2019-05-25 13:53:51 +08:00
|
|
|
//***********************************************
|
|
|
|
|
//**** 群组相关功能
|
|
|
|
|
//***********************************************
|
2019-05-25 07:55:30 +08:00
|
|
|
IMResult<Void> voidIMResult1 = GroupAdmin.dismissGroup("user1", "groupId1", null, null);
|
|
|
|
|
|
2019-05-24 21:08:31 +08:00
|
|
|
PojoGroupInfo groupInfo = new PojoGroupInfo();
|
|
|
|
|
groupInfo.setTarget_id("groupId1");
|
|
|
|
|
groupInfo.setOwner("user1");
|
|
|
|
|
groupInfo.setName("test_group");
|
|
|
|
|
groupInfo.setExtra("hello extra");
|
|
|
|
|
groupInfo.setPortrait("http://portrait");
|
|
|
|
|
List<PojoGroupMember> members = new ArrayList<>();
|
|
|
|
|
PojoGroupMember member1 = new PojoGroupMember();
|
|
|
|
|
member1.setMember_id(groupInfo.getOwner());
|
|
|
|
|
members.add(member1);
|
|
|
|
|
|
|
|
|
|
PojoGroupMember member2 = new PojoGroupMember();
|
|
|
|
|
member2.setMember_id("user2");
|
|
|
|
|
members.add(member2);
|
|
|
|
|
|
|
|
|
|
PojoGroupMember member3 = new PojoGroupMember();
|
|
|
|
|
member3.setMember_id("user3");
|
|
|
|
|
members.add(member3);
|
|
|
|
|
|
|
|
|
|
IMResult<OutputCreateGroupResult> resultCreateGroup = GroupAdmin.createGroup(groupInfo.getOwner(), groupInfo, members, null, null);
|
|
|
|
|
if (resultCreateGroup != null && resultCreateGroup.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("create group success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("create group failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMResult<PojoGroupInfo> resultGetGroupInfo = GroupAdmin.getGroupInfo(groupInfo.getTarget_id());
|
|
|
|
|
if (resultGetGroupInfo != null && resultGetGroupInfo.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
if (groupInfo.getExtra().equals(resultGetGroupInfo.getResult().getExtra())
|
|
|
|
|
&& groupInfo.getName().equals(resultGetGroupInfo.getResult().getName())
|
|
|
|
|
&& groupInfo.getOwner().equals(resultGetGroupInfo.getResult().getOwner())) {
|
|
|
|
|
System.out.println("get group success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("group info is not expected");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("create group failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMResult<Void> voidIMResult = GroupAdmin.transferGroup(groupInfo.getOwner(), groupInfo.getTarget_id(), "user2", null, null);
|
|
|
|
|
if (voidIMResult != null && voidIMResult.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("transfer success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("create group failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resultGetGroupInfo = GroupAdmin.getGroupInfo(groupInfo.getTarget_id());
|
|
|
|
|
if (resultGetGroupInfo != null && resultGetGroupInfo.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
if ("user2".equals(resultGetGroupInfo.getResult().getOwner())) {
|
|
|
|
|
groupInfo.setOwner("user2");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("group info is not expected");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("create group failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMResult<OutputGroupMemberList> resultGetMembers = GroupAdmin.getGroupMembers(groupInfo.getTarget_id());
|
|
|
|
|
if (resultGetMembers != null && resultGetMembers.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("get group member success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("create group failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-25 13:53:51 +08:00
|
|
|
voidIMResult = GroupAdmin.addGroupMembers("user1", groupInfo.getTarget_id(), Arrays.asList("use4", "user5"), null, null);
|
|
|
|
|
if (voidIMResult != null && voidIMResult.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("add group member success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("add group member failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
voidIMResult = GroupAdmin.kickoffGroupMembers("user1", groupInfo.getTarget_id(), Arrays.asList("use2", "user3"), null, null);
|
|
|
|
|
if (voidIMResult != null && voidIMResult.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("kickoff group member success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("kickoff group member failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//***********************************************
|
|
|
|
|
//**** 消息相关功能
|
|
|
|
|
//***********************************************
|
|
|
|
|
Conversation conversation = new Conversation();
|
|
|
|
|
conversation.setTarget("user2");
|
|
|
|
|
conversation.setType(ProtoConstants.ConversationType.ConversationType_Private);
|
|
|
|
|
MessagePayload payload = new MessagePayload();
|
|
|
|
|
payload.setType(1);
|
|
|
|
|
payload.setSearchableContent("hello world");
|
|
|
|
|
|
|
|
|
|
IMResult<SendMessageResult> resultSendMessage = MessageAdmin.sendMessage("user1", conversation, payload);
|
|
|
|
|
if (resultSendMessage != null && resultSendMessage.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("send message success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("send message failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
voidIMResult = MessageAdmin.recallMessage("user1", resultSendMessage.getResult().getMessageUid());
|
|
|
|
|
if (voidIMResult != null && voidIMResult.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("recall message success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("recall message failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2019-05-31 07:51:54 +08:00
|
|
|
IMResult<BroadMessageResult> resultBroadcastMessage = MessageAdmin.broadcastMessage("user1", 0, payload);
|
|
|
|
|
if (resultBroadcastMessage != null && resultBroadcastMessage.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("broad message success, send message to " + resultBroadcastMessage.getResult().getCount() + " users");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("broad message failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-28 16:13:50 +08:00
|
|
|
List<String> multicastReceivers = Arrays.asList("user2", "user3", "user4");
|
|
|
|
|
IMResult<MultiMessageResult> resultMulticastMessage = MessageAdmin.multicastMessage("user1", multicastReceivers, 0, payload);
|
|
|
|
|
if (resultMulticastMessage != null && resultMulticastMessage.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("multi message success, messageid is " + resultMulticastMessage.getResult().getMessageUid());
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("multi message failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-30 07:54:49 +08:00
|
|
|
IMResult<SystemSettingPojo> resultGetSystemSetting = GeneralAdmin.getSystemSetting(Group_Max_Member_Count);
|
|
|
|
|
if (resultGetSystemSetting != null && resultGetSystemSetting.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get system setting failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMResult<Void> resultSetSystemSetting = GeneralAdmin.setSystemSetting(Group_Max_Member_Count, "2000", "最大群人数为2000");
|
|
|
|
|
if (resultSetSystemSetting != null && resultSetSystemSetting.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get system setting failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resultGetSystemSetting = GeneralAdmin.getSystemSetting(Group_Max_Member_Count);
|
|
|
|
|
if (resultGetSystemSetting != null && resultGetSystemSetting.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS && resultGetSystemSetting.getResult().value.equals("2000")) {
|
|
|
|
|
System.out.println("success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("get system setting failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-25 13:53:51 +08:00
|
|
|
//初始化机器人API
|
2019-07-21 11:44:54 +08:00
|
|
|
RobotHttpUtils.init("http://localhost", "robot1", "123456");
|
2019-05-25 13:53:51 +08:00
|
|
|
//***********************************************
|
|
|
|
|
//**** 机器人API
|
|
|
|
|
//***********************************************
|
|
|
|
|
conversation = new Conversation();
|
|
|
|
|
conversation.setTarget("user2");
|
|
|
|
|
conversation.setType(ProtoConstants.ConversationType.ConversationType_Private);
|
|
|
|
|
payload = new MessagePayload();
|
|
|
|
|
payload.setType(1);
|
|
|
|
|
payload.setSearchableContent("hello world");
|
|
|
|
|
|
|
|
|
|
IMResult<SendMessageResult> resultRobotSendMessage = RobotService.sendMessage("robot1", conversation, payload);
|
|
|
|
|
if (resultRobotSendMessage != null && resultRobotSendMessage.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("robot send message success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("robot send message failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-21 11:44:54 +08:00
|
|
|
IMResult<InputOutputUserInfo> resultRobotGetUserInfo = RobotService.getUserInfo("userId1");
|
2019-05-25 13:53:51 +08:00
|
|
|
if (resultRobotGetUserInfo != null && resultRobotGetUserInfo.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
|
|
|
|
System.out.println("robot get user info success");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("robot get user info by userId failure");
|
|
|
|
|
System.exit(-1);
|
|
|
|
|
}
|
2019-05-24 16:12:57 +08:00
|
|
|
}
|
|
|
|
|
}
|