添加获取所有机器人的接口

This commit is contained in:
heavyrian2012
2026-04-05 11:28:46 +08:00
parent 33f2124352
commit 576fcf3e77
8 changed files with 163 additions and 0 deletions
@@ -465,6 +465,15 @@ public class Main {
System.exit(-1);
}
// 获取所有机器人列表(分页:每页100条,第0页)
IMResult<OutputGetRobotList> getRobotListIMResult = UserAdmin.getAllRobots(100, 0);
if (getRobotListIMResult != null && getRobotListIMResult.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
System.out.println("getRobotListIMResult success");
} else {
System.out.println("getRobotListIMResult failure");
System.exit(-1);
}
// 商业版专属功能
if (commercialServer) {
// 获取在线用户总数
@@ -117,6 +117,21 @@ public class UserAdmin {
return AdminHttpUtils.httpJsonPost(path, input, OutputGetUserList.class);
}
/**
* 获取所有机器人列表(分页)
* @param count 每页数量
* @param offset 偏移量
* @return 机器人列表
* @throws Exception 请求失败时抛出异常
*/
public static IMResult<OutputGetRobotList> getAllRobots(int count, int offset) throws Exception {
String path = APIPath.User_Get_All_Robots;
InputGetUserList input = new InputGetUserList();
input.count = count;
input.offset = offset;
return AdminHttpUtils.httpJsonPost(path, input, OutputGetRobotList.class);
}
/**
* 批量获取用户信息
* @param userIds 用户ID列表