添加获取在线用户信息和获取用户session信息的接口

This commit is contained in:
heavyrian2012
2023-11-28 11:04:12 +08:00
parent 08b813cd9f
commit b774e0d423
12 changed files with 248 additions and 8 deletions
@@ -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);
}
}