Example #1
0
 public PushUserProcessHandler(IBackgroundJobManager backgroundJobManager, IRealTimeNotifier realTimeNotifier, IDeviceService deviceService, ILogger <PushUserProcessHandler> logger)
 {
     _backgroundJobManager = backgroundJobManager;
     _realTimeNotifier     = realTimeNotifier;
     _deviceService        = deviceService;
     _logger = logger;
 }
Example #2
0
        public RealTimeNotifier_Tests()
        {
            var defaultNotificationDistributor = LocalIocManager.Resolve <DefaultNotificationDistributer>();

            LocalIocManager.IocContainer.Register(
                Component.For <INotificationDistributer>().Instance(defaultNotificationDistributor)
                .LifestyleSingleton()
                .IsDefault()
                );

            _publisher         = LocalIocManager.Resolve <INotificationPublisher>();
            _realTimeNotifier1 = Substitute.For <IRealTimeNotifier>();
            _realTimeNotifier2 = Substitute.For <IRealTimeNotifier2>();

            var realTimeNotifierType1 = _realTimeNotifier1.GetType();
            var realTimeNotifierType2 = _realTimeNotifier2.GetType();

            LocalIocManager.IocContainer.Register(
                Component.For(realTimeNotifierType1)
                .Instance(_realTimeNotifier1)
                .LifestyleSingleton()
                );
            LocalIocManager.IocContainer.Register(
                Component.For(realTimeNotifierType2)
                .Instance(_realTimeNotifier2)
                .LifestyleSingleton()
                );

            var notificationConfiguration = LocalIocManager.Resolve <INotificationConfiguration>();

            notificationConfiguration.Notifiers.Add(realTimeNotifierType1);
            notificationConfiguration.Notifiers.Add(realTimeNotifierType2);
        }
Example #3
0
 public UserAppService(IRepository <WOrder_Account, long> userRepository, IRepository <WOrder_AttachFile> fileRepository,
                       IRealTimeNotifier realTimeNotifier,
                       JPushHelper jPushHelper) : base(userRepository)
 {
     _accountRepository = userRepository;
     _fileRepository    = fileRepository;
     _realTimeNotifier  = realTimeNotifier;
     _jpushHelper       = jPushHelper;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationDistributionJob"/> class.
        /// </summary>
        public NotificationDistributer(
            INotificationDefinitionManager notificationDefinitionManager,
            INotificationStore notificationStore)
        {
            _notificationDefinitionManager = notificationDefinitionManager;
            _notificationStore = notificationStore;

            RealTimeNotifier = NullRealTimeNotifier.Instance;
        }
Example #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationDistributionJob"/> class.
        /// </summary>
        public NotificationDistributer(
            INotificationDefinitionManager notificationDefinitionManager,
            INotificationStore notificationStore)
        {
            _notificationDefinitionManager = notificationDefinitionManager;
            _notificationStore             = notificationStore;

            RealTimeNotifier = NullRealTimeNotifier.Instance;
        }
Example #6
0
        public MyChatHubDispatcher(
            IRealTimeNotifier realTimeNotifier,
            IOnlineClientManager onlineClientManager)
        {
            this.realTimeNotifier    = realTimeNotifier;
            this.onlineClientManager = onlineClientManager;

            AbpSession = NullAbpSession.Instance;
            Logger     = NullLogger.Instance;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationDistributionJob"/> class.
        /// 初始化<see cref="NotificationDistributionJob"/>类新的实例
        /// </summary>
        public NotificationDistributer(
            INotificationDefinitionManager notificationDefinitionManager,
            INotificationStore notificationStore,
            IUnitOfWorkManager unitOfWorkManager)
        {
            _notificationDefinitionManager = notificationDefinitionManager;
            _notificationStore             = notificationStore;
            _unitOfWorkManager             = unitOfWorkManager;

            RealTimeNotifier = NullRealTimeNotifier.Instance;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationDistributionJob"/> class.
        /// </summary>
        public NotificationDistributer(
            INotificationDefinitionManager notificationDefinitionManager,
            INotificationStore notificationStore,
            IUnitOfWorkManager unitOfWorkManager)
        {
            _notificationDefinitionManager = notificationDefinitionManager;
            _notificationStore = notificationStore;
            _unitOfWorkManager = unitOfWorkManager;

            RealTimeNotifier = NullRealTimeNotifier.Instance;
        }
Example #9
0
        public void SendNotify()
        {
            IRealTimeNotifier rtf = TwinkleContext.GetService <IRealTimeNotifier>();

            rtf.SendNotificationsAsync(new UserNotification[] {
                new UserNotification {
                    UserId = "admin", Data = new NotifyData {
                        Channel = "test", Data = new { key = "key", num = 2 }
                    }
                }
            });
        }
        public UserNotificationQueue(
            INotificationStore store, 
            INotificationDefinitionManager notificationDefinitionManager, 
            IUnitOfWorkManager unitOfWorkManager, 
            IRealTimeNotifier realTimeNotifier)
        {
            _store = store;
            _notificationDefinitionManager = notificationDefinitionManager;
            _unitOfWorkManager = unitOfWorkManager;
            _realTimeNotifier = realTimeNotifier;

            Logger = NullLogger.Instance;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="NotificationDistributionJob" /> class.
        /// </summary>
        public NotificationDistributer(
            INotificationDefinitionManager notificationDefinitionManager,
            INotificationStore notificationStore,
            IUnitOfWorkManager unitOfWorkManager,
            IGuidGenerator guidGenerator)
        {
            this.notificationDefinitionManager = notificationDefinitionManager;
            this.notificationStore             = notificationStore;
            this.unitOfWorkManager             = unitOfWorkManager;
            this.guidGenerator = guidGenerator;

            RealTimeNotifier = NullRealTimeNotifier.Instance;
        }
        public NotificationDistributer(
            INotificationDefinitionManager notificationDefinitionManager,
            INotificationRepository notificationRepository,
            ISettingService settingService,
            IRealTimeNotifier realTimeNotifier)
        {
            Logger            = NullLogger <NotificationDistributer> .Instance;
            _realTimeNotifier = realTimeNotifier;

            _notificationDefinitionManager = notificationDefinitionManager;
            _notificationRepository        = notificationRepository;
            _settingService = settingService;
        }
Example #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationDistributionJob"/> class.
        /// </summary>
        public DefaultNotificationDistributer(
            INotificationDefinitionManager notificationDefinitionManager,
            INotificationStore notificationStore,
            IUnitOfWorkManager unitOfWorkManager,
            IGuidGenerator guidGenerator)
        {
            _notificationDefinitionManager = notificationDefinitionManager;
            _notificationStore             = notificationStore;
            _unitOfWorkManager             = unitOfWorkManager;
            _guidGenerator = guidGenerator;

            RealTimeNotifier = NullRealTimeNotifier.Instance;
        }
Example #14
0
        public AccountAppService(
            UserRegistrationManager userRegistrationManager,
            INotificationSubscriptionManager notificationSubscriptionManager,
            IAppNotifier appNotifier,

            IRealTimeNotifier realTimeNotifier,
            IUserNotificationManager userNotificationManager)
        {
            _userRegistrationManager         = userRegistrationManager;
            _notificationSubscriptionManager = notificationSubscriptionManager;
            _appNotifier = appNotifier;

            _userNotificationManager = userNotificationManager;
            _realTimeNotifier        = realTimeNotifier;
        }
Example #15
0
 public OrderAppService(IRepository <WOrder_Order, long> orderRepository,
                        IRepository <WOrder_Handler> handlerRepository,
                        IRepository <WOrder_AttachFile> fileRepository,
                        JPushHelper jpushHelper,
                        IRealTimeNotifier realTimeNotifier,
                        IMessageAppService messageService,
                        IRepository <WOrder_Relation> relationRepository
                        ) : base(orderRepository)
 {
     _orderRepository    = orderRepository;
     _handlerRepository  = handlerRepository;
     _fileRepository     = fileRepository;
     _jpushHelper        = jpushHelper;
     _realTimeNotifier   = realTimeNotifier;
     _relationRepository = relationRepository;
     _messageService     = messageService;
 }
 public NotificationManager(
     INotificationPublisher notificationPublisher,
     INotificationSubscriptionManager notificationSubscriptionManager,
     ICacheManagerExtens cacheManagerExtens,
     IRealTimeNotifier realTimeNotifier,
     IAbpSessionExtens abpSessionExtens,
     IOnlineClientManager onlineClientManager,
     IRepository <UserInfo, long> userInfoRepository
     )
 {
     Logger = NullLogger.Instance;
     _notificationPublisher           = notificationPublisher;
     _notificationSubscriptionManager = notificationSubscriptionManager;
     _cacheManagerExtens  = cacheManagerExtens;
     _realTimeNotifier    = realTimeNotifier;
     AbpSessionExtens     = abpSessionExtens;
     _onlineClientManager = onlineClientManager;
     _userInfoRepository  = userInfoRepository;
 }
Example #17
0
        private void SendToClient(ReportArgs args, int status = 0)
        {
            string token = TwinkleContext.UserToken;

            AuthUser user = TwinkleContext.GetService <TokenAuthManager>().GetUser(token);

            IRealTimeNotifier rtf = TwinkleContext.GetService <IRealTimeNotifier>();

            rtf.SendNotificationsAsync(new UserNotification[] {
                new UserNotification {
                    TenantId = user.TenantId,
                    UserId   = user.UserId,
                    Data     = new NotifyData {
                        Channel = "signalr.reveive",
                        Data    = new {
                            uploadId = TwinkleContext.HttpContext.Request.Form["uploadId"].ToString(),//有待测试验证
                            message  = args.Message,
                            status   = args.Status
                        }
                    }
                }
            });
        }
Example #18
0
 public CategoryAppService(IRepository <model.Category, long> repository, IAbpSession AbpSession, IRealTimeNotifier not)
 {
     _Repository = repository;
     _AbpSession = AbpSession;
     _not        = not;
 }
Example #19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationDistributionJob"/> class.
        /// </summary>
        public NotificationDistributionJob(INotificationStore notificationStore)
        {
            _notificationStore = notificationStore;

            RealTimeNotifier = NullRealTimeNotifier.Instance;
        }
Example #20
0
 public NotificationDistributionJob(INotificationStore notificationStore, IRealTimeNotifier realTimeNotifier)
 {
     _notificationStore = notificationStore;
     _realTimeNotifier  = realTimeNotifier;
 }
Example #21
0
 public GoodsController(IRealTimeNotifier not, ICategoryAppService catServices)
 {
     _not         = not;
     _catServices = catServices;
 }