添加获取在线用户信息和获取用户session信息的接口
This commit is contained in:
@@ -324,6 +324,14 @@ public class Main {
|
||||
System.out.println("get user online failure");
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
IMResult<GetUserSessionResult> getUserSessionResultIMResult = UserAdmin.getUserSession("hygqmws2k");
|
||||
if (getUserSessionResultIMResult != null && getUserSessionResultIMResult.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
||||
System.out.println("get user session success");
|
||||
} else {
|
||||
System.out.println("get user session failure");
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -151,4 +151,9 @@ public class UserAdmin {
|
||||
input.setAuthCode(authCode);
|
||||
return AdminHttpUtils.httpJsonPost(path, input, OutputApplicationUserInfo.class);
|
||||
}
|
||||
|
||||
public static IMResult<GetUserSessionResult> getUserSession(String userId) throws Exception {
|
||||
InputUserId inputUserId = new InputUserId(userId);
|
||||
return AdminHttpUtils.httpJsonPost(APIPath.User_Session_List, inputUserId, GetUserSessionResult.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user