示例#1
0
        public virtual async Task SendAsync(SmsMessage smsMessage)
        {
            var request = new SendSmsRequest(
                new[] { smsMessage.PhoneNumber },
                GetStringProperty(smsMessage, AbpSmsTencentCloudConsts.TemplateIdPropertyName),
                GetStringProperty(smsMessage, AbpSmsTencentCloudConsts.SmsSdkAppidPropertyName,
                                  await _settingProvider.GetOrNullAsync(AbpSmsTencentCloudSettings.DefaultSmsSdkAppid)),
                GetStringProperty(smsMessage, AbpSmsTencentCloudConsts.SignPropertyName,
                                  await _settingProvider.GetOrNullAsync(AbpSmsTencentCloudSettings.DefaultSign)),
                GetTemplateParamSet(smsMessage),
                GetStringProperty(smsMessage, AbpSmsTencentCloudConsts.ExtendCodePropertyName,
                                  await _settingProvider.GetOrNullAsync(AbpSmsTencentCloudSettings.DefaultExtendCode)),
                GetStringProperty(smsMessage, AbpSmsTencentCloudConsts.SessionContextPropertyName),
                GetStringProperty(smsMessage, AbpSmsTencentCloudConsts.SenderIdPropertyName,
                                  await _settingProvider.GetOrNullAsync(AbpSmsTencentCloudSettings.DefaultSenderId))
                );

            var commonOptions = new AbpTencentCloudCommonOptions
            {
                SecretId  = await _settingProvider.GetOrNullAsync(AbpSmsTencentCloudSettings.DefaultSecretId),
                SecretKey = await _settingProvider.GetOrNullAsync(AbpSmsTencentCloudSettings.DefaultSecretKey)
            };

            await _requester.SendRequestAsync <SendSmsResponse>(request,
                                                                await _settingProvider.GetOrNullAsync(AbpSmsTencentCloudSettings.EndPoint), commonOptions);
        }
示例#2
0
        protected virtual async Task <PagedResultDto <SystemLogDto> > InternalGetListAsync(string logSetId, string topicId, DateTime startTime,
                                                                                           DateTime endTime, string queryString, string endpoint, AbpTencentCloudCommonOptions options,
                                                                                           int maxResultCount, int skipCount)
        {
            var possibleCount = 0;
            var dtos          = new List <SystemLogDto>();
            SearchLogResponse response;

            do
            {
                response = await _tencentCloudApiRequester.SendRequestAsync <SearchLogResponse>(
                    new SearchLogRequest(logSetId, topicId, startTime, endTime, queryString, Limit),
                    endpoint, options);

                dtos.AddRange(_searchLogResponseConverter.ToSystemLogDtoList(response));

                possibleCount += Limit;
            } while (response != null && !response.Listover && response.Results.Count > 0 &&
                     dtos.Count < maxResultCount + skipCount && possibleCount < 10000);

            return(new PagedResultDto <SystemLogDto>(10000, dtos.Skip(skipCount).Take(maxResultCount).ToList()));
        }