public RedisLock(IRedisService redis, ShellSettings shellSettings, ILogger <RedisLock> logger)
 {
     _redis    = redis;
     _hostName = Dns.GetHostName() + ':' + Process.GetCurrentProcess().Id;
     _prefix   = shellSettings.Name + ':';
     _logger   = logger;
 }
Beispiel #2
0
 public RateLimitFilter(int maxRequests, int lengthInMinutes, IRedisService redis, ILogger <RateLimitFilter> logger)
 {
     _redis           = redis;
     _maxRequests     = maxRequests;
     _lengthInMinutes = lengthInMinutes;
     _logger          = logger;
 }
Beispiel #3
0
        public PaymentsUIService(IRedisService redisService, ICardPaymentProcessor cardPaymentProcessor)
        {
            this.Repository = new SimpleRepository(ConnectionStrings.KEY_ORACLE_GENERAL, SimpleRepositoryOptions.RunMigrations);

            CardPaymentProcessor = cardPaymentProcessor;
            this.RedisService    = redisService;
        }
 public TaskHangFire(MySqlContext _mySqlContent, IRedisService redisHelper, ILogHelper _logHelper, IWXPayHelper _wXPayHelper)
 {
     mySqlContent = _mySqlContent;
     redis        = redisHelper;
     logHelper    = _logHelper;
     wXPayHelper  = _wXPayHelper;
 }
        public Service_xuangubao()
        {
            _clientFactory = AutofacContainer.Resolve <IHttpClientFactory>();

            _mapperService = AutofacContainer.Resolve <MapperService>();
            _redisService  = AutofacContainer.Resolve <IRedisService>();
        }
Beispiel #6
0
 public DiscordUserVerificationListener(IDiscordSocketClientProvider provider, IMediator mediator, RsPeerContext db, IRedisService redis)
 {
     _provider = provider;
     _mediator = mediator;
     _db       = db;
     _redis    = redis;
 }
 public ScheduleService()
 {
     _appSettings = AutofacContainer.Resolve <IOptions <AppSettings> >();
     // _clientFactory= AutofacContainer.Resolve<IHttpClientFactory>();
     _xuangubaoService = AutofacContainer.Resolve <Service_xuangubao>();
     _redisService     = AutofacContainer.Resolve <IRedisService>();
 }
 public AppStoresUIController(IAppStoreUIService appStoreUIService, IRedisService redisService, IFileService fileService, IFullTextSearchService fullTextSearchService)
     : base(appStoreUIService, redisService, fileService, fullTextSearchService)
 {
     this.UIService = appStoreUIService;
     this.RedisService = redisService;
     this.FileService = fileService;
 }
        public SqlEntityChangeTracker(string conn, IRedisService redisService)
        {
            sqlStudentTableDependency            = new SqlTableDependency <StudentDocument>(conn, "Students");
            sqlStudentTableDependency.OnChanged += OnStudentChanged;

            this.redisService = redisService;
        }
Beispiel #10
0
 public UnitTest1()
 {
     _accountService       = new ApiServiceFake();
     _redisService         = new ApiServiceFake();
     _accountsController   = new AccountsController(_accountService);
     _accountingController = new AccountingsController(_accountService, _redisService);
 }
 public CollisionAndNoFlyZoneRunner(IRedisService redisService, IUTMLiveService utmLiveService, IOptions <KafkaOpts> kafkaOpts)
 {
     _redisService = redisService;
     _redisService.Connect();
     _UTMLiveService = utmLiveService;
     _kafkaHost      = kafkaOpts.Value.Host;
 }
Beispiel #12
0
 public ReminderService(IRedisService redisService, IConfigurationRoot o, IDatabaseService databaseService, DiscordShardedClient discordSocketClient)
 {
     _redis    = redisService;
     _discord  = discordSocketClient;
     _database = databaseService;
     _redis.GetSubscriber().SubscribeAsync($"__keyevent@{o.GetSection("redis")["database"]}__:expired", OnKeyRemove).Wait();
 }
Beispiel #13
0
        public SMSService(IRESTfulClient restfulCient, IMailService paymentsService, IRedisService redisService)
        {
            this.RESTfulCient = restfulCient;
            PaymentsService   = paymentsService;
            RedisService      = redisService;
            LogTestRepository = new SimpleRepository(ConnectionStrings.KEY_ORACLE_GENERAL, SimpleRepositoryOptions.None);

            CTUSMSChargeProducts[1f] = new CTUSMSChargeProduct
            {
                Amount      = 1f,
                RequestKey  = "dkkg99",
                ResponseKey = "ert667",
                SID         = "5001"
            };

            CTUSMSChargeProducts[2f] = new CTUSMSChargeProduct
            {
                Amount      = 1f,
                RequestKey  = "dkf221",
                ResponseKey = "ery332",
                SID         = "5002"
            };

            CTUSMSChargeProducts[10f] = new CTUSMSChargeProduct
            {
                Amount      = 1f,
                RequestKey  = "dfd665",
                ResponseKey = "df2214",
                SID         = "5010"
            };
        }
 public DiscordCacheListener(IDiscordSocketClientProvider provider, IRedisService redis, IMediator mediator, RsPeerContext db)
 {
     _provider = provider;
     _redis    = redis;
     _mediator = mediator;
     _db       = db;
 }
Beispiel #15
0
        /// <summary>
        /// Constructor
        /// </summary>
        public RedisTests()
        {
            // Mock the IDistributed Cache
            Mock <IDistributedCache> distributedCacheMock = new Mock <IDistributedCache>();

            _redisService = new RedisService(distributedCacheMock.Object);
        }
 public RedisCacheReceiver(RedisConfiguration configuration, IRedisAttribute attribute, string lastValueKeyName)
 {
     _configuration    = configuration;
     _attribute        = attribute;
     _lastValueKeyName = lastValueKeyName;
     _service          = _configuration.RedisServiceFactory.CreateService(_configuration.ResolveConnectionString(attribute.ConnectionStringSetting));
 }
		public RedisSequence(IRedisService redis)
		{
			if(redis == null)
				throw new ArgumentNullException("redis");

			_redis = redis;
		}
Beispiel #18
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IRedisService redisService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseCors(
                options => options.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()
                );

            app.UseHttpsRedirection();

            app.UseSerilogRequestLogging();

            app.UseRouting();

            app.UseAuthentication();

            app.UseAuthorization();

            redisService.Connect();

            app.UseMiddleware <RequestResponseLogMiddleware>();

            app.UseMiddleware <ErrorLoggingMiddleware>();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
 public NotificationHandlerMiddleware(
     RequestDelegate next,
     IRedisService <Notification> redisNotificationService)
 {
     this.next = next;
     this.redisNotificationService = redisNotificationService;
 }
Beispiel #20
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IRedisService redisService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseSwagger();

            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "Board Game API V1");
            });

            redisService.Connect();

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
 public VideoController(IVideoService videoService, IRedisService redisService, IMemoryCache memoryCache, IVideoRankingService videoRankingService)
 {
     _videoService        = videoService;
     _redisService        = redisService;
     _memoryCache         = memoryCache;
     _videoRankingService = videoRankingService;
 }
Beispiel #22
0
 public ConsumerService(IKafkaService kafkaService, IRedisService redisService, ILogger <ConsumerService> logger)
 {
     _kafkaService = kafkaService;
     _redisService = redisService;
     _logger       = logger;
     _logger.LogDebug("Background service constructor.");
 }
Beispiel #23
0
 public SearchController(IElasticSearchService _elasticSearch,
                         IProductElasticService _productElasticService,
                         IRedisService redisService)
 {
     this._elasticSearch         = _elasticSearch;
     this._productElasticService = _productElasticService;
     this._redisService          = redisService;
 }
Beispiel #24
0
 public RedisBus(IRedisService redis, ShellSettings shellSettings, ILogger <RedisBus> logger)
 {
     _redis         = redis;
     _hostName      = Dns.GetHostName() + ':' + Process.GetCurrentProcess().Id;
     _channelPrefix = shellSettings.Name + ':';
     _messagePrefix = _hostName + '/';
     _logger        = logger;
 }
        public TodoController(IRedisService redis)
        {
            _redis = (RedisService)redis;

            int ViewCount = (int)this._redis.GetDatabase().StringGet("ViewCount");

            this._redis.GetDatabase().StringSet("ViewCount", ViewCount + 1);
        }
Beispiel #26
0
 public ProductsController(IQMGRepository repository, IBasketService basketService, ILoggingService logger, IRedisService redisService, UserManager <QMGUser> userManager)
 {
     _repository    = repository;
     _basketService = basketService;
     _logger        = logger;
     _redisService  = redisService;
     _userManager   = userManager;
 }
 public AuthOrgCommandHandler(IUserRepository userRepository, IHttpContextAccessor httpContextAccessor,
                              IServiceProvider serviceProvider, IRedisService redisService, ILogger <AuthOrgCommandHandler> logger)
 {
     _userRepository      = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
     _httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
     _serviceProvider     = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     _redisService        = redisService ?? throw new ArgumentNullException(nameof(redisService));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 public AppStoreUIServiceBase(IAppStoreUIService appStoreUIService, IRedisService redisService, IAppStoreService appStoreService, ISessionRepository sessionRepository, ICookieService cookieService, IFullTextSearchService fullTextSearchService)
     : base(redisService)
 {
     AppStoreUIService = appStoreUIService;
     AppStoreService = appStoreService;
     SessionRepository = sessionRepository;
     CookieService = cookieService;
     FullTextSearchService = fullTextSearchService;
 }
Beispiel #29
0
 public AppStoreService(IFileService fileService, IRedisService redisService, IAppStoreUIService appStoreUIService, IFullTextSearchService fullTextSearchService, IIMEICacheService imeiCacheService)
     : base(redisService)
 {
     this.FileService = fileService;
     this.RedisService = redisService;
     this.AppStoreUIService = appStoreUIService;
     this.FullTextSearchService = fullTextSearchService;
     this.IMEICacheService = imeiCacheService;
 }
Beispiel #30
0
 public CustomExceptionNotificationBehaviour(
     ILogger <TRequest> logger,
     IUserAccessor userAccessor,
     IRedisService <Notification> redisService)
 {
     this.logger       = logger;
     this.userAccessor = userAccessor;
     this.redisService = redisService;
 }
 public UserApiController(
     IUserService userService,
     IRedisService redisService,
     ILogger <UserApiController> logger
     ) : base(logger)
 {
     _userService  = userService;
     _redisService = redisService;
 }
Beispiel #32
0
 public ValuesController(IUserService userService, IRedisService redisService,
                         ILogService logService, IEventPublish eventPublish, IEventSubscribe eventSubscribe)
 {
     mUserService    = userService;
     mRedisService   = redisService;
     mLogService     = logService;
     mEventPublish   = eventPublish;
     mEventSubscribe = eventSubscribe;
 }
        public _RedisService_Transition_Tests()
        {
            IRedisLogger logger = new RedisLogger(new LoggerFactory(), new RedisKitOptions()
            {
                IsShowLog = false
            });

            _RedisService = new RedisService(CommonManager.Instance._RedisProvider, logger, new DefaultJosnSerializeService());
        }
Beispiel #34
0
 public PullMessage(IDiscordRestApi discordApi, IRedisService redisService) : base("AutoDiscordMsgRemove", redisService)
 {
     DiscordApi      = discordApi;
     DelayRetry      = new TimeSpan(0, 0, 0, 1, 0);
     DelayAfterError = new TimeSpan(0, 0, 2);
     DelayOnSucceed  = DelayRetry;
     OnException    += PullMessage_OnException;
     OnAction       += PullMessage_OnAction;
 }
        public UserInteractServiceTest()
        {
            _redisServiceMock = new Mock<IRedisService>();
            redisService = _redisServiceMock.Object;

            _logServiceMock = new Mock<ILogger>();
            logService = _logServiceMock.Object;

            _requestRepoMock = new Mock<IRequestRepository>();
            requestRepo = _requestRepoMock.Object;

            EntityMapping.Config();
        }
Beispiel #36
0
 public UserService(
     IEmailService emailService,
     IRedisService redisService,
     IEncryptionService encryptionService,
     IMapper mapper,
     IHttpContextAccessor contextAccessor
     )
 {
     _emailService = emailService;
     _encryptionService = encryptionService;
     _mapper = mapper;
     _context = contextAccessor.HttpContext;
     _userQueryHandler = new UserQueryHandler(redisService);
 }
        public AppStoresWapUIServiceTest()
        {
            _redisServiceMock = new Mock<IRedisService>();
            redisService = _redisServiceMock.Object;

            _redisServiceMock2 = new Mock<IRedisService2>();
            redisService2 = _redisServiceMock2.Object;

            _redisClientMock = new Mock<IRedisClient>();
            redisClient = _redisClientMock.Object;

            _appStoreUIServiceMock = new Mock<IAppStoreUIService>();
            appStoreUIService = _appStoreUIServiceMock.Object;

            _logServiceMock = new Mock<ILogger>();
            logService = _logServiceMock.Object;

            _fileServiceMock = new Mock<IFileService>();
            fileService = _fileServiceMock.Object;

            _fullTextSearchServiceMock = new Mock<IFullTextSearchService>();
            fullTextSearchService = _fullTextSearchServiceMock.Object;

            _requestRepoMock = new Mock<IRequestRepository>();
            requestRepo = _requestRepoMock.Object;

            appStoreUIRealService = new AppStoreUIService(fs, redisReal);

            sesionRepository = new Mock<ISessionRepository>();
            sesionRepositoryReal = new SessionRepository();

            cookieServiceReal =new CookieService();
            cookieService = new Mock<ICookieService>();

            appStoreServiceReal = new AppStoreService(fs, redisReal, appStoreUIRealService, new FullTextSearchService(redisReal),new IMEICacheService(redisReal));
            appStoreServiceReal.RedisService2 = new RedisService2();
            appStoreService = new AppStoreService(fs, redisService, appStoreUIRealService, new FullTextSearchService(redisService), new IMEICacheService(redisReal));
            appStoreService.RedisService2 = redisService2;

            appStoresWapUIServiceReal = new AppStoresWapUISerivces(appStoreUIRealService, redisReal, appStoreServiceReal, sesionRepositoryReal, cookieServiceReal, new FullTextSearchService(redisReal));
            appStoresWapUIServiceReal.RedisService2 = new RedisService2();
            appStoresWapUIService = new AppStoresWapUISerivces(appStoreUIService, redisService, appStoreService, sesionRepository.Object, cookieService.Object, fullTextSearchService);

            appStoresWapUIService.RedisService2 = redisService2;
            Bootstrapper.Start();
            redisReal.FlushAll();
        }
        public AppStoresServiceTest()
        {
            _redisServiceMock = new Mock<IRedisService>();
            redisService = _redisServiceMock.Object;

            _redisServiceMock2 = new Mock<IRedisService2>();
            redisService2 = _redisServiceMock2.Object;

            _redisClientMock = new Mock<IRedisClient>();
            redisClient = _redisClientMock.Object;

            _appStoreUIServiceMock = new Mock<IAppStoreUIService>();
            appStoreUIService = _appStoreUIServiceMock.Object;

            _fileServiceMock = new Mock<IFileService>();
            fileService = _fileServiceMock.Object;

            _logServiceMock = new Mock<ILogger>();
            logService = _logServiceMock.Object;

            _requestRepoMock = new Mock<IRequestRepository>();
            requestRepo = _requestRepoMock.Object;

            _fullTextSearchServiceMock = new Mock<IFullTextSearchService>();
            fullTextSearchService = _fullTextSearchServiceMock.Object;
            _imeiCacheServiceMock = new Mock<IIMEICacheService>();
            imeiCacheService = _imeiCacheServiceMock.Object;

            appStoreUIRealService = new AppStoreUIService(fs, redis);
            appStoreUIRealService.RedisService2 = redis2;
            appStoreRealService = new AppStoreService(fs, redis, appStoreUIRealService, fullTextSearchService, imeiCacheService);
            appStoreRealService.RedisService2 = redis2;

            appStoreMockService = new AppStoreService(_fileServiceMock.Object, _redisServiceMock.Object,
                _appStoreUIServiceMock.Object, _fullTextSearchServiceMock.Object,_imeiCacheServiceMock.Object);
            appStoreMockService.RedisService2 = redisService2;
            redis.FlushAll();

            EntityMapping.Config();
        }
		public QueueCountCommand(IRedisService redis) : base(redis, "Count")
		{
		}
 public CommonServiceTest()
 {
     _redisServiceMock = new Mock<IRedisService>();
     redisService = _redisServiceMock.Object;
 }
		public HashsetGetCommand(IRedisService redis) : base(redis, "Get")
		{
		}
 public TYDStatisticsService(IRedisService redisService)
 {
     this.OracleRepository = new SimpleRepository(ConnectionStrings.Key_TYD_LOG, SimpleRepositoryOptions.RunMigrations);
     this.RedisService = redisService;
 }
 public PostLikesService(IPostLikesLogic postLikesLogic, IRedisService redisService)
 {
     _postLikesLogic = postLikesLogic;
     _redisService = redisService;
 }
 public NotificationService(IRedisService redisService)
 {
     _redisService = redisService;
 }
		public DictionaryRemoveCommand(IRedisService redis) : base(redis, "Remove")
		{
		}
		public DictionaryCountCommand(IRedisService redis) : base(redis, "Count")
		{
		}
		public RemoveCommand(IRedisService redis) : base(redis, "Remove")
		{
		}
		public DictionarySetCommand(IRedisService redis) : base(redis, "Set")
		{
		}
		public DictionaryClearCommand(IRedisService redis) : base(redis, "Clear")
		{
		}
		public DictionaryDecrementCommand(IRedisService redis) : base(redis, "Decrement")
		{
		}
		public QueueDequeueCommand(IRedisService redis) : base(redis, "Out")
		{
		}
		public QueueTakeCommand(IRedisService redis) : base(redis, "Take")
		{
		}
 public ViewCountService(IViewCountLogic viewCountLogic, IRedisService redisService)
 {
     _viewCountLogic = viewCountLogic;
     _redisService = redisService;
 }
		public SetCommand(IRedisService redis) : base(redis, "Set")
		{
		}
 public CommentsService(ICommentsLogic commentsLogic, IRedisService redisService)
 {
     _commentsLogic = commentsLogic;
     _redisService = redisService;
 }
 public ChatMessagesService(IChatMessagesLogic chatMessagesLogic, IRedisService redisService)
 {
     _chatMessagesLogic = chatMessagesLogic;
     _redisService = redisService;
 }
		public QueueClearCommand(IRedisService redis) : base(redis, "Clear")
		{
		}
		public IncrementCommand(IRedisService redis) : base(redis, "Increment")
		{
		}
		public QueueEnqueueCommand(IRedisService redis) : base(redis, "In")
		{
		}
Beispiel #60
0
 public PushController(IRedisService redisService, IUserInteractUIService userInteractUIService)
 {
     RedisService = redisService;
     UserInteractUIService = userInteractUIService;
 }