/// <summary>
 ///
 /// </summary>
 /// <param name="logger"></param>
 /// <param name="jsonProviders"></param>
 /// <param name="xmlProviders"></param>
 public WebChatProcessRequest(ILogger <WebChatProcessRequest> logger, ICollection <IJsonProvider> jsonProviders,
                              ICollection <IXmlProvider> xmlProviders)
 {
     _logger       = logger;
     _jsonProvider = InjectionSelectionCommon.GetImplement(jsonProviders);
     _xmlProvider  = InjectionSelectionCommon.GetImplement(xmlProviders);
 }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="logServices"></param>
 /// <param name="jsonProviders"></param>
 /// <param name="xmlProviders"></param>
 public WebChatProcessRequest(ICollection <ILogProvider> logServices, ICollection <IJsonProvider> jsonProviders,
                              ICollection <IXmlProvider> xmlProviders)
 {
     _logService   = InjectionSelectionCommon.GetImplement(logServices);
     _jsonProvider = InjectionSelectionCommon.GetImplement(jsonProviders);
     _xmlProvider  = InjectionSelectionCommon.GetImplement(xmlProviders);
 }
 /// <summary>
 /// 短信服务
 /// </summary>
 public SmsService(AliSmsConfig smsConfig, ICollection <IJsonProvider> jsonProviders,
                   ICollection <IXmlProvider> xmlProviders)
 {
     _smsConfig    = smsConfig;
     _jsonProvider = InjectionSelectionCommon.GetImplement(jsonProviders);
     _xmlProvider  = InjectionSelectionCommon.GetImplement(xmlProviders);
     ValidationCommon.Check(smsConfig, "请完善阿里云短信配置信息", HttpStatus.Err.Name);
 }
Esempio n. 4
0
 /// <summary>
 ///
 /// </summary>
 public RedisCacheService(RedisConfig redisConfig, ICollection <IJsonProvider> jsonProviders)
 {
     _jsonProvider = InjectionSelectionCommon.GetImplement(jsonProviders);
     ValidationCommon.Check(redisConfig, "redis配置异常", HttpStatus.Err.Name);
     new RedisConfigValidator().Validate(redisConfig).Check();
     _prefix = redisConfig.Name;
     CsRedisHelper.InitializeConfiguration(redisConfig);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="jsonProviders"></param>
 public AuthenticateDemoService(ICollection <IJsonProvider> jsonProviders)
 {
     _jsonProvider         = InjectionSelectionCommon.GetImplement(jsonProviders);
     _restClient           = new RestClient("http://ai.baidu.com");
     _restClient.UserAgent =
         "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36";
     _request =
         new RestRequest(
             $"aidemo",
             Method.POST)
     {
         RequestFormat = RestSharp.DataFormat.Json
     };
     _request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
     _request.AddHeader("Origin", "http://ai.baidu.com");
     _request.AddHeader("Host", "ai.baidu.com");
     _request.AddHeader("Referer", "http://ai.baidu.com/tech/imagecensoring");
     _request.AddHeader("Accept", "*/*");
     _request.AddHeader("Accept-Language", "zh-CN,zh;q=0.9");
     _request.AddParameter("type", "user_defined");
 }
Esempio n. 6
0
 /// <summary>
 /// 短信服务
 /// </summary>
 public SmsProvider(AliSmsConfig smsConfig, ICollection <IJsonProvider> jsonProviders) : base(smsConfig)
 {
     _jsonProvider = InjectionSelectionCommon.GetImplement(jsonProviders);
     ValidationCommon.Check(smsConfig, "请完善阿里云短信配置信息", HttpStatus.Err.Name);
 }
 /// <summary>
 /// 基类UCloud实现
 /// </summary>
 public BaseStorageProvider(ICollection <ILogService> logServices, UCloudStorageConfig uCloudConfig)
 {
     LogService   = InjectionSelectionCommon.GetImplement(logServices);
     UCloudConfig = uCloudConfig;
     ValidationCommon.Check(uCloudConfig, "Uc云存储配置异常", HttpStatus.Err.Name);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="smsConfig"></param>
 /// <param name="jsonProviders"></param>
 public VoiceSmsProvider(AliSmsConfig smsConfig, ICollection <IJsonProvider> jsonProviders) : base(smsConfig)
 {
     _jsonProvider = InjectionSelectionCommon.GetImplement(jsonProviders);
 }
Esempio n. 9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="logServices"></param>
 /// <param name="errCode">错误码</param>
 public ModelValidationFilter(ICollection <ILogProvider> logServices, int?errCode = null)
 {
     ErrCode     = errCode ?? HttpStatus.Err.Id;
     _logService = InjectionSelectionCommon.GetImplement(logServices);
 }
Esempio n. 10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="next"></param>
 /// <param name="jsonProviders"></param>
 public ErrorHandlingMiddleware(RequestDelegate next, ICollection <IJsonProvider> jsonProviders)
 {
     _next         = next;
     _jsonProvider = InjectionSelectionCommon.GetImplement(jsonProviders);
 }