Add new agnostic challonge provider
This commit is contained in:
@@ -18,12 +18,12 @@ namespace LaDOSE.Api.Controllers
|
||||
public class SmashController : Controller
|
||||
{
|
||||
|
||||
private IEventService _service;
|
||||
private IExternalProviderService _service;
|
||||
|
||||
private IMapper _mapper;
|
||||
|
||||
// GET
|
||||
public SmashController(IMapper mapper, IEventService service)
|
||||
public SmashController(IMapper mapper, IExternalProviderService service)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_service = service;
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace LaDOSE.Api.Controllers
|
||||
public class TestController : Controller
|
||||
{
|
||||
|
||||
private IEventService _service;
|
||||
private IExternalProviderService _service;
|
||||
|
||||
private IMapper _mapper;
|
||||
|
||||
// GET
|
||||
public TestController(IMapper mapper, IEventService service)
|
||||
public TestController(IMapper mapper, IExternalProviderService service)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_service = service;
|
||||
|
||||
@@ -15,12 +15,12 @@ namespace LaDOSE.Api.Controllers
|
||||
public class TournamentController : Controller
|
||||
{
|
||||
|
||||
private IEventService _service;
|
||||
private IExternalProviderService _service;
|
||||
|
||||
private IMapper _mapper;
|
||||
|
||||
// GET
|
||||
public TournamentController(IMapper mapper, IEventService service)
|
||||
public TournamentController(IMapper mapper, IExternalProviderService service)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_service = service;
|
||||
@@ -48,9 +48,11 @@ namespace LaDOSE.Api.Controllers
|
||||
throw new Exception("Invalid arguments");
|
||||
}
|
||||
|
||||
var tournamentsResult = await _service.GetTournamentsResult(ids);
|
||||
var test = await _service.GetChallongeEvents(ids);
|
||||
|
||||
return _mapper.Map<TournamentsResultDTO>(tournamentsResult);
|
||||
//var tournamentsResult = await _service.GetTournamentsResult(ids);
|
||||
|
||||
return _mapper.Map<TournamentsResultDTO>(new TournamentsResultDTO());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,6 @@ namespace LaDOSE.Api
|
||||
private void AddDIConfig(IServiceCollection services)
|
||||
{
|
||||
|
||||
services.AddTransient<IChallongeProvider>(p => new ChallongeProvider(this.Configuration["ApiKey:ChallongeApiKey"]));
|
||||
|
||||
services.AddScoped<IUserService, UserService>();
|
||||
services.AddScoped<IGameService, GameService>();
|
||||
@@ -150,8 +149,18 @@ namespace LaDOSE.Api
|
||||
services.AddScoped<IWordPressService, WordPressService>();
|
||||
services.AddScoped<ITodoService, TodoService>();
|
||||
services.AddScoped<IEventService, EventService>();
|
||||
|
||||
services.AddScoped<IPlayerService, PlayerService>();
|
||||
services.AddScoped<ISmashProvider>(p => new SmashProvider(p.GetRequiredService<IGameService>(), p.GetRequiredService<IPlayerService>(), this.Configuration["ApiKey:SmashApiKey"]));
|
||||
services.AddTransient<IChallongeProvider>(p => new ChallongeProvider( p.GetRequiredService<IGameService>(),
|
||||
p.GetRequiredService<IEventService>(),
|
||||
p.GetRequiredService<IPlayerService>(),
|
||||
this.Configuration["ApiKey:ChallongeApiKey"]));
|
||||
|
||||
services.AddTransient<ISmashProvider>(p => new SmashProvider( p.GetRequiredService<IGameService>(),
|
||||
p.GetRequiredService<IEventService>(),
|
||||
p.GetRequiredService<IPlayerService>(),
|
||||
this.Configuration["ApiKey:SmashApiKey"]));
|
||||
services.AddScoped<IExternalProviderService, ExternalProviderService>();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user