public async Task <IEnumerable <ResUdv> > ListUdv(UdfTargetType targetType, string targetId, CancellationToken cancellationToken = default) { var param = new UdvParam(targetType, targetId); var res = await client.Request <UdvResponse>(param.CreateRequest(), cancellationToken); return(AuthingUtils.ConvertUdv(res.Result)); }
public async Task <List <KeyValuePair <string, object> > > GetUdfValue(string userId, CancellationToken cancellation = default) { var param = new UdvParam(UdfTargetType.USER, userId); var res = await client.Request <UdvResponse>(param.CreateRequest(), cancellation); return(AuthingUtils.ConverUdvToKeyValuePair(res.Result)); }
/// <summary> /// 获取用户自定义字段的值列表 /// </summary> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task <IEnumerable <UserDefinedData> > ListUdv(CancellationToken cancellationToken = default) { await CheckLoggedIn(); var param = new UdvParam(UdfTargetType.USER, User.Id); var res = await Request <UdvResponse>(param.CreateRequest(), cancellationToken); return(res.Result); }
public async Task <KeyValuePair <string, object> > GetSpecificUdfValue(string roleId, string udfKey, CancellationToken cancellationToken = default) { var param = new UdvParam(UdfTargetType.ROLE, roleId); var res = await client.Request <UdvResponse>(param.CreateRequest(), cancellationToken); var udfList = AuthingUtils.ConverUdvToKeyValuePair(res.Result); var keyValuePair = udfList.Where(item => item.Key == udfKey).ToList(); return(keyValuePair[0]); }
/// <summary> /// 获取用户自定义字段的值列表 /// </summary> /// <param name="userId">用户 ID</param> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task <IEnumerable <UserDefinedData> > ListUdv( string userId, CancellationToken cancellationToken = default) { var param = new UdvParam(UdfTargetType.USER, userId); await client.GetAccessToken(); var res = await client.Request <UdvResponse>(param.CreateRequest(), cancellationToken); return(res.Result); }