Test Creation DesktopApp

This commit is contained in:
2019-03-09 14:03:25 +01:00
parent e8fd116eab
commit ac9614a70a
34 changed files with 1131 additions and 189 deletions

View File

@@ -11,20 +11,62 @@ namespace LaDOSE.Api.Controllers
[Route("api/[controller]")]
public class WordPressController : Controller
{
public IGameService GameService { get; }
private IWordPressService _service;
// GET
public WordPressController(IWordPressService service)
public WordPressController(IWordPressService service, IGameService gameService )
{
GameService = gameService;
_service = service;
}
private IWordPressService _service;
[HttpGet("WPEvent")]
public List<WPEvent> Event()
{
return _service.GetWpEvent();
var wpEvents = _service.GetWpEvent();
foreach (var wpEvent in wpEvents)
{
foreach (var wpEventWpBooking in wpEvent.WPBookings)
{
wpEventWpBooking.WPEvent = null;
wpEventWpBooking.WPUser.WPBookings = null;
}
}
return wpEvents;
}
[HttpGet("GetUsers/{wpEventId}/{gameId}")]
public List<WPUser> GetUsers(int wpEventId, int gameId)
{
var game = GameService.GetById(gameId);
return _service.GetBooking(wpEventId, game);
}
[HttpGet("GetUsersOptions/{wpEventId}/{gameId}")]
public List<WPUser> GetUsersOptions(int wpEventId, int gameId)
{
var game = GameService.GetById(gameId);
return _service.GetBookingOptions(wpEventId, game);
}
[HttpGet("UpdateDb")]
public bool UpdateDb()
{
return _service.UpdateBooking();
}
[HttpGet("CreateChallonge/{gameId:int}/{wpEventId:int}")]
public bool CreateChallonge(int gameId, int wpEventId)
{
return _service.CreateChallonge(gameId, wpEventId);
}
}
}