using JiShe.CollectBus.Samples;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;

namespace JiShe.CollectBus.Handlers
{
    public class SampleHandler : IDistributedEventHandler<SampleDto>,
        ITransientDependency
    {

        private readonly ILogger<SampleHandler> _logger;

        public SampleHandler(ILogger<SampleHandler> logger)
        {
            _logger = logger;
        }

        public async Task HandleEventAsync(SampleDto eventData)
        {
            _logger.LogWarning($"topic Test1 message: {eventData.Value.ToString()}");
        }
    }

    public class SampleHandler2 : IDistributedEventHandler<SampleDto2>,
        ITransientDependency
    {

        private readonly ILogger<SampleHandler2> _logger;

        public SampleHandler2(ILogger<SampleHandler2> logger)
        {
            _logger = logger;
        }

        public async Task HandleEventAsync(SampleDto2 eventData)
        {
            _logger.LogWarning($"topic Test2 message: {eventData.Value.ToString()}");
        }
    }
}
