Пример #1
0
 public Handler()
 {
     _slackService     = new SlackService();
     _dynamoRepository = new DynamoRepository();
     _slackMessage     = new SlackMessage(_dynamoRepository); //hacky...
     _eventIdList      = new List <EventId>();
 }
Пример #2
0
 public Communicator(ILogger <Communicator> logger, Mapper mapper, ISlackService slackService)
 {
     client = new HttpClient {
         Timeout = TimeSpan.FromSeconds(15)
     };
     this.logger                 = logger;
     this.mapper                 = mapper;
     this.slackService           = slackService;
     statsCache                  = new();
     patientsCache               = new();
     hospitalsCache              = new();
     hospitalsListCache          = new();
     municipalitiesListCache     = new();
     retirementHomesListCache    = new();
     retirementHomesCache        = new();
     municipalityCache           = new();
     regionCasesCache            = new();
     healthCentersDayCache       = new();
     statsWeeklyDayCache         = new();
     owidCountriesCache          = new();
     monthlyDeathsSloveniaCache  = new();
     labTestsCache               = new();
     dailyDeathsSloveniaCache    = new();
     ageDailyDeathsSloveniaCache = new();
     sewageCache                 = new();
     schoolCasesCache            = new();
     schoolAbsencesCache         = new();
     schoolRegimesCache          = new();
     vaccinationsCache           = new();
     summaryCache                = new SummaryCache(default, default, default, default, default, default, default);
Пример #3
0
 public SlackController(IRestaurantService restaurantService, ISlackService slackService, IStorageService storageService, ILogger <SlackController> log)
 {
     RestaurantService = restaurantService;
     SlackService      = slackService;
     StorageService    = storageService;
     Log = log;
 }
Пример #4
0
        public SlackNotifyer(IServiceProvider serviceProvider)
        {
            this._slackService = serviceProvider.GetService <ISlackService>();
            var configuration = serviceProvider.GetService <IConfiguration>();

            this._webHookUrl = configuration["Slack:WebHookUrl"];
        }
Пример #5
0
 public Communicator(ILogger <Communicator> logger, Mapper mapper, ISlackService slackService)
 {
     client = new HttpClient {
         Timeout = TimeSpan.FromSeconds(15)
     };
     this.logger                 = logger;
     this.mapper                 = mapper;
     this.slackService           = slackService;
     statsCache                  = new ArrayEndpointCache <StatsDaily>();
     regionCache                 = new ArrayEndpointCache <RegionsDay>();
     patientsCache               = new ArrayEndpointCache <PatientsDay>();
     hospitalsCache              = new ArrayEndpointCache <HospitalsDay>();
     hospitalsListCache          = new ArrayEndpointCache <Hospital>();
     municipalitiesListCache     = new ArrayEndpointCache <Municipality>();
     retirementHomesListCache    = new ArrayEndpointCache <RetirementHome>();
     retirementHomesCache        = new ArrayEndpointCache <RetirementHomesDay>();
     deceasedPerRegionsDayCache  = new ArrayEndpointCache <DeceasedPerRegionsDay>();
     municipalityDayCache        = new ArrayEndpointCache <MunicipalityDay>();
     healthCentersDayCache       = new ArrayEndpointCache <HealthCentersDay>();
     statsWeeklyDayCache         = new ArrayEndpointCache <StatsWeeklyDay>();
     owidCountriesCache          = new DictionaryEndpointCache <string, Models.Owid.Country>();
     monthlyDeathsSloveniaCache  = new ArrayEndpointCache <MonthlyDeathsSlovenia>();
     labTestsCache               = new ArrayEndpointCache <LabTestDay>();
     dailyDeathsSloveniaCache    = new ArrayEndpointCache <DailyDeathsSlovenia>();
     ageDailyDeathsSloveniaCache = new ArrayEndpointCache <AgeDailyDeathsSloveniaDay>();
     errors = new ConcurrentDictionary <string, object>();
 }
 public CeoPersonaAsistantService(ISlackService slackService, IFirebaseService firebaseService
                                  , IConfiguration configuration)
 {
     _slackService    = slackService;
     _firebaseService = firebaseService;
     _ceoMemberId     = configuration["SlackSettings:CeoMemberId"];
 }
Пример #7
0
 public TaskRepeater(ILogger <TaskRepeater> logger, IQueuingService queuingService, ISapService sapService, ISlackService slackService)
 {
     _logger         = logger;
     _queuingService = queuingService;
     _sapService     = sapService;
     _slackService   = slackService;
 }
Пример #8
0
 public JwtSecurity(UserManager <Dal.Entities.Identity.ApplicationUser> userManager, ILogger <JwtSecurity> logger, IMapper mapper, IEmailService emailService, ISlackService slackService)
 {
     _userManager  = userManager;
     _logger       = logger;
     _mapper       = mapper;
     _emailService = emailService;
     _slackService = slackService;
 }
Пример #9
0
 public RunCommand(IMediator mediator, IIdGenerator <long> idGenerator, ISystemClock clock, ISlackService slackService, ILogger <RunCommand> logger) : base(slackService)
 {
     _mediator     = mediator;
     _idGenerator  = idGenerator;
     _clock        = clock;
     _slackService = slackService;
     _logger       = logger;
 }
Пример #10
0
 public SlackController(ICommandRunner commandRunner, ISlackService slackService,
                        ISlackMessageVerifier messageVerifier, ILogger <SlackController> logger)
 {
     _commandRunner   = commandRunner;
     _slackService    = slackService;
     _messageVerifier = messageVerifier;
     _logger          = logger;
 }
 public ContractNotificationService(IESIService esiService, IMapper mapper,
                                    IDiscordService discordService, ISlackService slackService, IDataStorageService dataStorageService)
 {
     _esiService         = esiService;
     _mapper             = mapper;
     _slackService       = slackService;
     _discordService     = discordService;
     _dataStorageService = dataStorageService;
 }
Пример #12
0
        public SlackNotifyerTest()
        {
            this._stubSlackService  = Substitute.For <ISlackService>();
            this._stubConfiguration = Substitute.For <IConfiguration>();

            this._stubServiceProvider = Substitute.For <IServiceProvider>();
            this._stubServiceProvider.GetService <ISlackService>().Returns(this._stubSlackService);
            this._stubServiceProvider.GetService <IConfiguration>().Returns(this._stubConfiguration);
        }
Пример #13
0
        public SlackNotifyer(IServiceProvider serviceProvider)
        {
            _slackService = serviceProvider.GetService <ISlackService>();
            var configuration = serviceProvider.GetService <IConfiguration>();

            _webHookUrl = configuration["Slack:WebHookUrl"];

            _slackGroupIdDictionary = configuration.GetSection("Slack:GroupId").Get <Dictionary <string, string> >();
        }
Пример #14
0
 public SlackTenant(
     ILogger logger,
     ISlackService slackService,
     IComponentContext componentContext)
 {
     _logger = logger;
     _slackService = slackService;
     _componentContext = componentContext;
 }
 public BusinessPartnerController(
     ILogger <BusinessPartnerController> logger,
     IBusinessPartnerService businessPartnerService,
     ISlackService slackService)
 {
     _logger = logger;
     _businessPartnerService = businessPartnerService;
     _slackService           = slackService;
 }
Пример #16
0
 public SlackTenant(
     ILogger logger,
     ISlackService slackService,
     IComponentContext componentContext)
 {
     _logger           = logger;
     _slackService     = slackService;
     _componentContext = componentContext;
 }
Пример #17
0
 public Worker(ILogger <Worker> logger, IServiceScopeFactory serviceScopeFactory, ISlackService serviceSlack)
 {
     _logger = logger;
     _serviceScopeFactory = serviceScopeFactory;
     _schedule            = CrontabSchedule.Parse(Schedule, new CrontabSchedule.ParseOptions {
         IncludingSeconds = true
     });
     _nextRun      = _schedule.GetNextOccurrence(DateTime.Now);
     _serviceSlack = serviceSlack;
 }
Пример #18
0
        public LimboAction(IServiceProvider services, LimboSettings settings)
        {
            this.Settings = settings;

            this.GitHub = services.GetService <IGitHubService>();
            this.GitHub.SetCredentials(settings.GitHubUsername, settings.GitHubPersonalAccessToken);
            this.GitHub.BaseAddress = settings.GithubApiBaseUrl;

            this.Slack = services.GetService <ISlackService>();
            this.Slack.SetCredentials(settings.SlackBotApiToken);
        }
Пример #19
0
 public App(
     ISlackService slack,
     IStatisticsService statistics,
     IOptions <AppSettings> config,
     ILogger <App> logger)
 {
     _slack      = slack;
     _statistics = statistics;
     _logger     = logger;
     _config     = config.Value;
 }
 public SlackMemberJoinedCapabilityDomainEventHandler(
     ILogger <SlackMemberJoinedCapabilityDomainEventHandler> logger,
     ISlackFacade slackFacade,
     ICapabilityRepository capabilityRepository,
     ISlackService slackService)
 {
     _logger               = logger;
     _slackFacade          = slackFacade;
     _capabilityRepository = capabilityRepository;
     _slackService         = slackService;
 }
Пример #21
0
 public GitHubController(
     IDataStore dataStore,
     IGitHubService gitHubService,
     ISlackService slackService,
     IDevOpsService devOpsService)
 {
     this.dataStore = dataStore;
     _gitHubService = gitHubService;
     _slackService  = slackService;
     _devOpsService = devOpsService;
 }
Пример #22
0
 public EntitySubscriber(
     ICapturedRouterUrlHelper capturedRouterUrlHelper,
     ILogger <EntitySubscriber> logger,
     ISlackService slackService,
     IBroker broker)
 {
     _capturedRouterUrlHelper = capturedRouterUrlHelper;
     _slackService            = slackService;
     _broker = broker;
     _logger = logger;
 }
Пример #23
0
 public JobsController(IJobsService jobsService, ICategoriesService categoriesService, IHireTypesService hiretypesService, ITwitterService twitterService, LegacyApiClient apiClient, IConfiguration configuration, ICompaniesService companiesService, ISlackService slackService)
 {
     _jobsService       = jobsService;
     _categoriesService = categoriesService;
     _hiretypesService  = hiretypesService;
     _twitterService    = twitterService;
     _apiClient         = apiClient;
     _configuration     = configuration;
     _companiesService  = companiesService;
     _slackService      = slackService;
 }
        public SlackIntegration(SlackIntegrationConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration),
                                                "Slack Integration configuration has not been provided.");
            }

            _configuration = configuration;
            _slackService  = _configuration.SlackServiceProvider();
        }
Пример #25
0
        public SlackIntegration(SlackIntegrationConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration),
                    "Slack Integration configuration has not been provided.");
            }

            _configuration = configuration;
            _slackService = _configuration.SlackServiceProvider();
        }
Пример #26
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, ISlackService slackService, ICommunicator communicator)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseRouting();
            app.UseCors(CorsPolicy);
            app.UseResponseCompression();
            app.UseResponseCaching();

            app.UseAuthorization();
            app.Use(async(context, next) =>
            {
                context.Response.Headers.Add("SchemaVersion", SchemaVersion);
                context.Response.GetTypedHeaders().CacheControl =
                    new Microsoft.Net.Http.Headers.CacheControlHeaderValue()
                {
                    Public = true,
                    MaxAge = System.TimeSpan.FromSeconds(10)
                };
                context.Response.Headers[Microsoft.Net.Http.Headers.HeaderNames.Vary] =
                    new string[] { "Accept-Encoding" };
                await next.Invoke();
            });
            // Register the Swagger generator and the Swagger UI middleware
            app.UseOpenApi();
            app.UseSwaggerUi3();

            // notifies slack when an exception occurs
            app.UseExceptionHandler(errorApp =>
            {
                errorApp.Run(async context =>
                {
                    //var exceptionHandlerPathFeature = context.Features.Get<IExceptionHandlerPathFeature>();
                    //var exception = exceptionHandlerPathFeature?.Error;
                    try
                    {
                        await slackService.SendNotificationAsync($"DATA API REST service failed on {context.Request?.Path}", CancellationToken.None);
                    }
                    catch
                    { }
                });
            });

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapMetrics();
                endpoints.MapControllers();
            });
        }
Пример #27
0
 public EntityReplySubscriber(
     ICapturedRouterUrlHelper capturedRouterUrlHelper,
     ILogger <EntitySubscriber> logger,
     IEntityStore <Question> entityStore,
     ISlackService slackService,
     IBroker broker)
 {
     _capturedRouterUrlHelper = capturedRouterUrlHelper;
     _slackService            = slackService;
     _entityStore             = entityStore;
     _broker = broker;
     _logger = logger;
 }
Пример #28
0
 public NotificationService(
     ILogger <NotificationService> logger,
     IConfiguration config,
     IDataContext context,
     IEmailService email,
     ISlackService slack
     )
 {
     _logger  = logger;
     _config  = config;
     _context = context;
     _email   = email;
     _slack   = slack;
 }
Пример #29
0
        public ConnectionsController(
            IQueryHandler <FindConnectionsByClientTypeClientIdChannelTypeChannelId, IEnumerable <Connection> >
            findConnectionsByClientTypeClientIdChannelTypeChannelIdQueryHandler,
            ISlackFacade slackFacade,
            ICapabilityRepository capabilityRepository,
            ISlackService slackService)
        {
            _findConnectionsByClientTypeClientIdChannelTypeChannelIdQueryHandler =
                findConnectionsByClientTypeClientIdChannelTypeChannelIdQueryHandler;

            _slackFacade          = slackFacade;
            _capabilityRepository = capabilityRepository;
            _slackService         = slackService;
        }
Пример #30
0
 public BillingService(
     IQueuingService queuingService,
     IDateTimeProvider dateTimeProvider,
     ILogger <BillingService> logger,
     ISlackService slackService,
     IEnumerable <IBillingMapper> billingMappers,
     IEnumerable <IBillingValidation> billingValidations)
 {
     _queuingService     = queuingService;
     _dateTimeProvider   = dateTimeProvider;
     _logger             = logger;
     _slackService       = slackService;
     _billingMappers     = billingMappers;
     _billingValidations = billingValidations;
 }
Пример #31
0
 public PhotosService(
     IUnitOfWork unitOfWork,
     IUsersService usersService,
     IImageUploader imageUploader,
     IClassMapper mapper,
     IConfiguration configuration,
     ISlackService slackService
     )
 {
     _unitOfWork    = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork));
     _usersService  = usersService ?? throw new ArgumentNullException(nameof(usersService));
     _imageUploader = imageUploader ?? throw new ArgumentNullException(nameof(imageUploader));
     _mapper        = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _slackService  = slackService ?? throw new ArgumentNullException(nameof(slackService));
 }
Пример #32
0
        public Worker(ILogger <Worker> logger, IConfiguration configuration, ISlackService slackService)
        {
            _logger                  = logger;
            _slackService            = slackService;
            _cancellationTokenSource = new CancellationTokenSource();

            var conf = new ConsumerConfig
            {
                GroupId          = "aoj69-consumer",
                BootstrapServers = configuration.GetSection("KafkaServer").Value,
                AutoOffsetReset  = AutoOffsetReset.Earliest,
                EnableAutoCommit = false
            };

            _consumer = new ConsumerBuilder <Ignore, string>(conf).Build();
            _consumer.Subscribe(configuration.GetSection("KafkaTopic").Value);
        }
Пример #33
0
 public Security()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Пример #34
0
 public LoggedIn()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Пример #35
0
 public LoggedIn(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public TeamAuthenticationTest(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public TeamAuthenticationTest()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public TestStart()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public TestStart(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Пример #40
0
 public Shutdown()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Пример #41
0
 public Publish(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Пример #42
0
 public Security(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Пример #43
0
 public Event()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Пример #44
0
 public ListDeletion()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public Initialize()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Пример #46
0
 public Social(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Пример #47
0
 public Shutdown(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Пример #48
0
 public Social()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public Initialize(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public Membership()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Пример #51
0
 public ListDeletion(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public MvcException()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Пример #53
0
 public Event(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Пример #54
0
 public Indexing(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public Membership(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Пример #56
0
 public Indexing()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Пример #57
0
 //TODO: After the hackathon we should introduce Dependency Injection 
 public Publish()
 {
    _message = new SlackMessage();
     _service = new SlackService(); 
 }
 public MvcException(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Пример #59
0
 public Campaign()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Пример #60
0
 public Campaign(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }