server api添加通过邮箱获取用户列表的接口

This commit is contained in:
heavyrian2012
2024-03-25 19:00:42 +08:00
parent a906bf352d
commit c4421fc9ed
8 changed files with 198 additions and 0 deletions
@@ -178,6 +178,15 @@ public class Main {
System.out.println("get user info by userId failure");
System.exit(-1);
}
IMResult<OutputUserInfoList> userInfoListIMResult = UserAdmin.getUserByEmail("[email protected]");
if(userInfoListIMResult.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS || userInfoListIMResult.getErrorCode() == ErrorCode.ERROR_CODE_NOT_EXIST) {
System.out.println("getUserByEmail success");
} else {
System.out.println("getUserByEmail failure");
System.exit(-1);
}
InputOutputUserInfo updateUserInfo = new InputOutputUserInfo();
updateUserInfo.setUserId(System.currentTimeMillis()+"");
updateUserInfo.setDisplayName("updatedUserName");
@@ -24,6 +24,11 @@ public class UserAdmin {
return AdminHttpUtils.httpJsonPost(path, getUserInfo, InputOutputUserInfo.class);
}
public static IMResult<OutputUserInfoList> getUserByEmail(String email) throws Exception {
String path = APIPath.User_Get_Email_Info;
return AdminHttpUtils.httpJsonPost(path, email, OutputUserInfoList.class);
}
public static IMResult<OutputGetUserList> getAllUsers(int count, int offset) throws Exception {
String path = APIPath.User_Get_All;
InputGetUserList input = new InputGetUserList();