Package io.rong.imkit.usermanage.handler

## Class GroupOperationsHandler

- All Implemented Interfaces:

      public class GroupOperationsHandler

  群组操作

  注意：使用完毕后需要调用 stop 方法释放资源

  Since:

    5.12.0

  Author:

    rongcloud

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `public final static DataKey<CoreErrorCode>` | `KEY_CREATE_GROUP` |
    `public final static DataKey<CoreErrorCode>` | `KEY_CREATE_GROUP_EXAMINE` |
    `public final static DataKey<CoreErrorCode>` | `KEY_INVITE_USERS_TO_GROUP` |
    `public final static DataKey<Boolean>` | `KEY_KICK_GROUP_MEMBERS` |
    `public final static DataKey<Boolean>` | `KEY_UPDATE_GROUP_INFO` |
    `public final static DataKey<Boolean>` | `KEY_UPDATE_GROUP_INFO_EXAMINE` |
    `public final static DataKey<Boolean>` | `KEY_SET_GROUP_MEMBER_INFO` |
    `public final static DataKey<Boolean>` | `KEY_SET_GROUP_MEMBER_INFO_EXAMINE` |
    `public final static DataKey<Boolean>` | `KEY_QUIT_GROUP` |
    `public final static DataKey<Boolean>` | `KEY_DISMISS_GROUP` |
    `public final static DataKey<Boolean>` | `KEY_SET_GROUP_REMARK` |
    `public final static DataKey<Boolean>` | `KEY_ADD_GROUP_FOLLOWS` |
    `public final static DataKey<Boolean>` | `KEY_REMOVE_GROUP_FOLLOWS` |
    `public final static DataKey<Boolean>` | `KEY_TRANSFER_GROUP_OWNER` |
    `public final static DataKey<Boolean>` | `KEY_ADD_GROUP_MANAGERS` |
    `public final static DataKey<Boolean>` | `KEY_REMOVE_GROUP_MANAGERS` |
    `public final static DataKey<CoreErrorCode>` | `KEY_JOIN_GROUP` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GroupOperationsHandler(ConversationIdentifier conversationIdentifier)` | 构造方法初始化群组ID

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `createGroup(GroupInfo groupInfo, List<String> inviteeUserIds)` |
    `void` | `createGroupExamine(GroupInfo groupInfo, List<String> inviteeUserIds)` |
    `void` | `inviteUsersToGroup(List<String> userIds)` | 邀请用户加入群组
    `void` | `kickGroupMembers(List<String> userIds, QuitGroupConfig config)` | 踢出群成员
    `void` | `updateGroupInfo(GroupInfo groupInfo)` | 更新群组信息
    `void` | `updateGroupInfoExamine(GroupInfo groupInfo)` | 更新群组信息
    `void` | `setGroupMemberInfo(String userId, String nickname, String extra)` | 设置群成员信息
    `void` | `setGroupMemberInfoExamine(String userId, String nickname, String extra)` | 设置群成员信息
    `void` | `setGroupRemark(String remark)` | 设置群备注
    `void` | `quitGroup(QuitGroupConfig config)` | 退出群组
    `void` | `dismissGroup()` | 解散群组
    `void` | `addGroupFollows(List<String> userIds)` | 添加群关注人员
    `void` | `removeGroupFollows(List<String> userIds)` | 移除群关注人员
    `void` | `transferGroupOwner(String newOwnerId, boolean quitGroup, QuitGroupConfig config)` | 转让群
    `void` | `addGroupManagers(List<String> userIds)` | 添加群管理员
    `void` | `removeGroupManagers(List<String> userIds)` | 移除群管理员
    `void` | `joinGroup()` | 加入群组 加入群组权限决定是否可以直接加入群组。当群组需要审批时，会返回 RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT 状态码，表示需要等待群主或管理员审批。

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GroupOperationsHandler

          GroupOperationsHandler(ConversationIdentifier conversationIdentifier)

      构造方法初始化群组ID
      Parameters:
        `conversationIdentifier` - 会话标识符

  - ### Method Detail

    - #### createGroup

          @Deprecated() void createGroup(GroupInfo groupInfo, List<String> inviteeUserIds)

    - #### createGroupExamine

           void createGroupExamine(GroupInfo groupInfo, List<String> inviteeUserIds)

    - #### inviteUsersToGroup

           void inviteUsersToGroup(List<String> userIds)

      邀请用户加入群组

      Parameters:
        `userIds` - 用户ID列表

    - #### kickGroupMembers

           void kickGroupMembers(List<String> userIds, QuitGroupConfig config)

      踢出群成员

      Parameters:
        `userIds` - 用户ID列表
        `config` - 退出群组配置

    - #### updateGroupInfo

          @Deprecated() void updateGroupInfo(GroupInfo groupInfo)

      更新群组信息

      Parameters:
        `groupInfo` - 群组信息

    - #### updateGroupInfoExamine

           void updateGroupInfoExamine(GroupInfo groupInfo)

      更新群组信息

      Parameters:
        `groupInfo` - 群组信息

    - #### setGroupMemberInfo

          @Deprecated() void setGroupMemberInfo(String userId, String nickname, String extra)

      设置群成员信息

      Parameters:
        `userId` - 用户ID
        `nickname` - 昵称
        `extra` - 扩展信息

    - #### setGroupMemberInfoExamine

           void setGroupMemberInfoExamine(String userId, String nickname, String extra)

      设置群成员信息

      Parameters:
        `userId` - 用户ID
        `nickname` - 昵称
        `extra` - 扩展信息

    - #### setGroupRemark

           void setGroupRemark(String remark)

      设置群备注

      Parameters:
        `remark` - 群备注

    - #### quitGroup

           void quitGroup(QuitGroupConfig config)

      退出群组

      Parameters:
        `config` - 退出群组配置

    - #### dismissGroup

           void dismissGroup()

      解散群组

    - #### addGroupFollows

           void addGroupFollows(List<String> userIds)

      添加群关注人员

      Parameters:
        `userIds` - 用户ID列表
      Since:

        5.12.2

    - #### removeGroupFollows

           void removeGroupFollows(List<String> userIds)

      移除群关注人员

      Parameters:
        `userIds` - 用户ID列表
      Since:

        5.12.2

    - #### transferGroupOwner

           void transferGroupOwner(String newOwnerId, boolean quitGroup, QuitGroupConfig config)

      转让群

      Parameters:
        `newOwnerId` - 新群主ID
        `quitGroup` - 是否退出群组
        `config` - 退出群组配置
      Since:

        5.12.2

    - #### addGroupManagers

           void addGroupManagers(List<String> userIds)

      添加群管理员

      Parameters:
        `userIds` - 用户ID列表
      Since:

        5.12.2

    - #### removeGroupManagers

           void removeGroupManagers(List<String> userIds)

      移除群管理员

      Parameters:
        `userIds` - 用户ID列表
      Since:

        5.12.2

    - #### joinGroup

           void joinGroup()

      加入群组

      加入群组权限决定是否可以直接加入群组。当群组需要审批时，会返回 RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT 状态码，表示需要等待群主或管理员审批。

      Since:

        5.34.0