Exemple #1
0
 public WeChatWorkHttpAdapter(
     WeChatWorkSettings settings,
     IStorage storage,
     IBackgroundTaskQueue taskQueue = null,
     ILogger logger = null)
 {
     _settings            = settings;
     _wechatClient        = new WeChatWorkClient(settings, storage, logger);
     _wechatMessageMapper = new WeChatWorkMessageMapper(_wechatClient, settings.UploadTemporaryMedia, logger);
     _logger    = logger ?? NullLogger.Instance;
     _taskQueue = taskQueue;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WeChatWorkMessageMapper"/> class,
 /// using a injected configuration and wechatClient.
 /// </summary>
 /// <param name="uploadTemporaryMedia">The IConfiguration instance need to used by mapper.</param>
 /// <param name="wechatClient">The WeChat client need to be used when need to call WeChat api, like upload media, etc.</param>
 /// <param name="logger">The ILogger implementation this adapter should use.</param>
 public WeChatWorkMessageMapper(WeChatWorkClient wechatClient, bool uploadTemporaryMedia, ILogger logger = null)
 {
     _wechatClient         = wechatClient;
     _uploadTemporaryMedia = uploadTemporaryMedia;
     _logger = logger ?? NullLogger.Instance;
 }