Example #1
0
            /// <summary>
            /// 批量移除用户
            /// </summary>
            /// <param name="code">分组唯一标志</param>
            /// <param name="userIds">用户 ID 列表</param>
            /// <param name="cancellationToken"></param>
            /// <returns></returns>
            public async Task <CommonMessage> RemoveUsers(
                string code,
                IEnumerable <string> userIds,
                CancellationToken cancellationToken = default)
            {
                var param = new RemoveUserFromGroupParam(userIds)
                {
                    Code = code,
                };

                var res = await client.Request <RemoveUserFromGroupResponse>(param.CreateRequest(), cancellationToken);

                return(res.Result);
            }
Example #2
0
            /// <summary>
            /// 退出分组
            /// </summary>
            /// <param name="userId">用户 ID</param>
            /// <param name="group">分组 ID</param>
            /// <param name="cancellationToken"></param>
            /// <returns></returns>
            public async Task <CommonMessage> RemoveGroup(
                string userId,
                string group,
                CancellationToken cancellationToken = default)
            {
                var param = new RemoveUserFromGroupParam(new string[] { userId })
                {
                    Code = group
                };

                var res = await client.Request <RemoveUserFromGroupResponse>(param.CreateRequest(), cancellationToken);

                return(res.Result);
            }