public GetUserGroupsAdminParam(GetUserGroupsParam param) { foreach (var p in param.GetType().GetProperties()) { GetType().GetProperty(p.Name)?.SetValue(this, p.GetValue(param)); } }
/// <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); }
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 })); }