コード例 #1
0
 public CollisionAndNoFlyZoneRunner(IRedisService redisService, IUTMLiveService utmLiveService, IOptions <KafkaOpts> kafkaOpts)
 {
     _redisService = redisService;
     _redisService.Connect();
     _UTMLiveService = utmLiveService;
     _kafkaHost      = kafkaOpts.Value.Host;
 }
コード例 #2
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();
            });
        }
コード例 #3
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();
            });
        }
コード例 #4
0
ファイル: WeatherRunner.cs プロジェクト: n0bis/healthydrone
 public WeatherRunner(IRedisService redisService, IWeatherService weatherService, IOptions <WeatherRuleOpts> weatherOpts, IOptions <KafkaOpts> kafkaOpts)
 {
     _redisService   = redisService;
     _weatherService = weatherService;
     _redisService.Connect();
     _weatherRule = new WeatherRule {
         MaxTemp = weatherOpts.Value.MaxTemp, MinTemp = weatherOpts.Value.MinTemp, RainPrecipitation = weatherOpts.Value.RainPrecipitation, WindSpeed = weatherOpts.Value.WindSpeed
     };
     _kafkaHost = kafkaOpts.Value.Host;
 }
コード例 #5
0
 public AlertsController(IRedisService redisService, IHubContext <AlertHub> hubContext)
 {
     _redisService = redisService;
     _redisService.Connect();
     _hubContext = hubContext;
 }