Пример #1
0
 public TeamElectionWorker(IServiceProvider services, IntervalWorkerConfiguration config, Guid sourceId) : base(services, config)
 {
     _updateStore = services.GetRequiredService <UpdateStore>();
     _db          = services.GetRequiredService <Database>();
     _client      = services.GetRequiredService <HttpClient>();
     _sourceId    = sourceId;
 }
Пример #2
0
 public StreamReplay(UpdateStore updateStore, Database db, ILogger logger, GameUpdateStore gameUpdateStore)
 {
     _updateStore     = updateStore;
     _db              = db;
     _gameUpdateStore = gameUpdateStore;
     _logger          = logger.ForContext <StreamReplay>();
 }
Пример #3
0
 public IlianaV2Importer(IServiceProvider services, Guid sourceId) : base(services)
 {
     _sourceId        = sourceId;
     _db              = services.GetRequiredService <Database>();
     _updateStore     = services.GetRequiredService <UpdateStore>();
     _gameUpdateStore = services.GetRequiredService <GameUpdateStore>();
 }
Пример #4
0
 public StatsheetsWorker(IServiceProvider services, IntervalWorkerConfiguration config, Guid sourceId) : base(services, config)
 {
     _sourceId    = sourceId;
     _db          = services.GetRequiredService <Database>();
     _client      = services.GetRequiredService <HttpClient>();
     _updateStore = services.GetRequiredService <UpdateStore>();
     _clock       = services.GetRequiredService <IClock>();
 }
Пример #5
0
        public IdolLogsImporter(IServiceProvider services, Guid sourceId) : base(services)
        {
            _sourceId  = sourceId;
            FileFilter = "idols-*.json.gz";

            _db    = services.GetRequiredService <Database>();
            _store = services.GetRequiredService <UpdateStore>();
        }
Пример #6
0
        public MongodbTributesImporter(IServiceProvider services, Guid sourceId) : base(services)
        {
            FileFilter = "tributes.dump.json.gz";

            _sourceId = sourceId;
            _db       = services.GetRequiredService <Database>();
            _store    = services.GetRequiredService <UpdateStore>();
        }
Пример #7
0
 public FlatFileExport(UpdateStore updateStore, ILogger logger, GameUpdateStore gameUpdateStore,
                       GameStore gameStore)
 {
     _updateStore     = updateStore;
     _gameUpdateStore = gameUpdateStore;
     _gameStore       = gameStore;
     _logger          = logger.ForContext <FlatFileExport>();
 }
Пример #8
0
        public HourlyLogsImporter(IServiceProvider services, Guid sourceId) : base(services)
        {
            _sourceId  = sourceId;
            FileFilter = "blaseball-hourly-*.json.gz";

            _db          = services.GetRequiredService <Database>();
            _updateStore = services.GetRequiredService <UpdateStore>();
        }
Пример #9
0
 public IngestController(IConfiguration config, Database db, UpdateStore updateStore, ILogger logger, GameUpdateStore gameUpdateStore)
 {
     _config          = config;
     _db              = db;
     _logger          = logger.ForContext <IngestController>();
     _updateStore     = updateStore;
     _gameUpdateStore = gameUpdateStore;
 }
Пример #10
0
 public ElectionResultsWorker(IServiceProvider services, ThrottledIntervalWorkerConfiguration config, Guid sourceId) : base(services, config)
 {
     _sourceId    = sourceId;
     _config      = config;
     _db          = services.GetRequiredService <Database>();
     _updateStore = services.GetRequiredService <UpdateStore>();
     _client      = services.GetRequiredService <HttpClient>();
     _clock       = services.GetRequiredService <IClock>();
 }
Пример #11
0
 public MiscEndpointWorker(IServiceProvider services, MiscEndpointWorkerConfiguration config, Guid sourceId) :
     base(services, config)
 {
     _config      = config;
     _sourceId    = sourceId;
     _client      = services.GetRequiredService <HttpClient>();
     _updateStore = services.GetRequiredService <UpdateStore>();
     _db          = services.GetRequiredService <Database>();
     _clock       = services.GetRequiredService <IClock>();
 }
Пример #12
0
 public StreamDataWorker(IServiceProvider services, Guid sourceId) : base(services)
 {
     _sourceId    = sourceId;
     _clock       = services.GetRequiredService <IClock>();
     _updateStore = services.GetRequiredService <UpdateStore>();
     _eventStream = services.GetRequiredService <EventStream>();
     _db          = services.GetRequiredService <Database>();
     _gameStore   = services.GetRequiredService <GameUpdateStore>();
     _clock       = services.GetRequiredService <IClock>();
 }
Пример #13
0
 public Task Handle(object command)
 {
     return(command switch
     {
         Create cmd => HandleCreate(cmd),
         UpdateStore cmd
         => HandleUpdateAsync(cmd.Id, async c => await UpdateStore(cmd.LocationId, c),
                              c => c.UpdateStoreName(cmd.Name)),
         ChangeLocation cmd
         => HandleUpdateAsync(cmd.Id, async c => await ChangeLocationAsync(c, cmd.Location.Id)),
         DeleteStore cmd => HandleUpdateAsync(cmd.Id, _ => this._repository.RemoveAsync(cmd.Id)),
         _ => Task.CompletedTask
     });
Пример #14
0
        public async Task <IActionResult> Update([FromForm] UpdateStore update)
        {
            try
            {
                await Mediator.Send(update);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequestWithMessage(e.Message));
            }
        }
Пример #15
0
 public PusherWorker(IServiceProvider services, Guid sourceId) : base(services)
 {
     _sourceId = sourceId;
     _pusher   = new Pusher("ddb8c477293f80ee9c63", new PusherOptions
     {
         Cluster    = "us3",
         Authorizer = new HttpAuthorizer("https://api.blaseball.com/api/pusher/auth")
     });
     _db               = services.GetRequiredService <Database>();
     _updateStore      = services.GetRequiredService <UpdateStore>();
     _client           = services.GetRequiredService <HttpClient>();
     _pusherEventStore = services.GetRequiredService <PusherEventStore>();
     _clock            = services.GetRequiredService <IClock>();
 }
Пример #16
0
 public StadiumsController(UpdateStore updateStore)
 {
     _updateStore = updateStore;
 }
Пример #17
0
 public FightsController(UpdateStore updateStore)
 {
     _updateStore = updateStore;
 }
Пример #18
0
 public static Task UpdateStore(this IFlurlClient http, UpdateStore model)
 {
     return(http.Request("api", "store", "update")
            .PostUrlEncodedAsync(model));
 }
Пример #19
0
 public MiscUpdatesController(UpdateStore updateStore)
 {
     _updateStore = updateStore;
 }