Esempio n. 1
0
            /// <summary>
            /// 批量添加用户
            /// </summary>
            /// <param name="code">分组唯一标志</param>
            /// <param name="userIds">用户 ID 列表</param>
            /// <param name="cancellationToken"></param>
            /// <returns></returns>
            public async Task <CommonMessage> AddUsers(
                string code,
                IEnumerable <string> userIds,
                CancellationToken cancellationToken = default)
            {
                var param = new AddUserToGroupParam(userIds)
                {
                    Code = code,
                };

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

                return(res.Result);
            }
Esempio n. 2
0
            /// <summary>
            /// 加入分组
            /// </summary>
            /// <param name="userId">用户 ID</param>
            /// <param name="group">分组 ID</param>
            /// <param name="cancellationToken"></param>
            /// <returns></returns>
            public async Task <CommonMessage> AddGroup(
                string userId,
                string group,
                CancellationToken cancellationToken = default)
            {
                var param = new AddUserToGroupParam(new string[] { userId })
                {
                    Code = group
                };

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

                return(res.Result);
            }