示例#1
0
 public GetUserGroupsAdminParam(GetUserGroupsParam param)
 {
     foreach (var p in param.GetType().GetProperties())
     {
         GetType().GetProperty(p.Name)?.SetValue(this, p.GetValue(param));
     }
 }
示例#2
0
            /// <summary>
            /// 获取用户分组列表
            /// </summary>
            /// <param name="userId">用户 ID</param>
            /// <param name="cancellationToken"></param>
            /// <returns></returns>
            public async Task <PaginatedGroups> ListGroups(string userId, CancellationToken cancellationToken = default)
            {
                var param = new GetUserGroupsParam(userId);

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

                return(res.Result.Groups);
            }
示例#3
0
        public ActionResult <PaginatedResponse <UserGroup> > GetUserGroups([FromQuery] GetUserGroupsParam param)
        {
            var user = (UserAdmin)_userRepository.GetUser(Guid.Parse(User.Identity.Name));

            return(GetUserGroups(new GetUserGroupsAdminParam(param)
            {
                OrganizationCode = user.Domain.OrganizationCode
            }));
        }