admin 2 years ago
parent
commit
acd63108b5

+ 9 - 9
src/CallCenter.Application/Handlers/FlowControl/QueueVisitorToGroupBusyNotificationHandler.cs

@@ -1,24 +1,24 @@
-using CallCenter.Calls;
+using CallCenter.Caches;
+using CallCenter.Calls;
 using CallCenter.Notifications;
+using CallCenter.Realtimes;
 using MediatR;
 
 namespace CallCenter.Application.Handlers
 {
     public class QueueVisitorToGroupBusyNotificationHandler:INotificationHandler<QueueVisitorToGroupBusyNotification>
     {
-        private readonly ICallRepository _callRepository;
-        private readonly ICallDetailRepository _callDetailRepository;
-
-
-        public QueueVisitorToGroupBusyNotificationHandler(ICallRepository callRepository, ICallDetailRepository callDetailRepository)
+        private readonly ICallCacheManager _callCacheManager;
+        private readonly IRealtimeService _realtimeService;
+        public QueueVisitorToGroupBusyNotificationHandler( ICallCacheManager callCacheManager, IRealtimeService realtimeService)
         {
-            _callRepository = callRepository;
-            _callDetailRepository = callDetailRepository;
+            _callCacheManager = callCacheManager;
+            _realtimeService = realtimeService;
         }
 
         public async Task Handle(QueueVisitorToGroupBusyNotification notification, CancellationToken cancellationToken)
         {
-            //TODO
+            await _realtimeService.CallQueueAsync(_callCacheManager.GetCallQueueList(), cancellationToken);
         }
     }
 }