Files
LaDOSE/LaDOSE.Src/LaDOSE.Api/Controllers/EventController.cs

41 lines
1.2 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LaDOSE.Business.Interface;
using LaDOSE.Entity;
2018-10-22 01:13:42 +02:00
using LaDOSE.Entity.Wordpress;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace LaDOSE.Api.Controllers
{
2018-10-22 01:13:42 +02:00
[Authorize]
[Produces("application/json")]
[Route("api/[controller]")]
2018-10-12 20:52:59 +02:00
public class EventController : GenericController<IEventService, Event>
{
2018-10-22 01:13:42 +02:00
private IGameService _gameService;
public EventController(IEventService service,IGameService gameService) : base(service)
{
2018-10-22 01:13:42 +02:00
this._gameService = gameService;
}
[HttpGet("GetUsers/{eventId}/{wpEventId}/{gameId}")]
public List<WPUser> GetUsers(int eventId, int wpEventId,int gameId)
{
var game = _gameService.GetById(gameId);
return _service.GetBooking(eventId, wpEventId,game);
}
2018-10-22 01:13:42 +02:00
[HttpGet("Generate/{eventId}/{wpEventId}")]
public bool GenerateChallonge(int eventId, int wpEventId)
{
2018-10-12 20:52:59 +02:00
return _service.CreateChallonge(eventId, wpEventId);
}
}
}