2018-10-07 15:15:11 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2022-07-30 20:00:31 +02:00
|
|
|
|
using AutoMapper;
|
2018-10-07 15:15:11 +02:00
|
|
|
|
using LaDOSE.Business.Interface;
|
2022-07-30 20:00:31 +02:00
|
|
|
|
using LaDOSE.DTO;
|
2018-10-07 15:15:11 +02:00
|
|
|
|
using LaDOSE.Entity;
|
2018-10-22 01:13:42 +02:00
|
|
|
|
using LaDOSE.Entity.Wordpress;
|
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2018-10-07 15:15:11 +02:00
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
|
|
namespace LaDOSE.Api.Controllers
|
|
|
|
|
|
{
|
2022-07-30 20:00:31 +02:00
|
|
|
|
|
2022-07-31 02:19:28 +02:00
|
|
|
|
[Authorize]
|
2018-10-07 15:15:11 +02:00
|
|
|
|
[Produces("application/json")]
|
|
|
|
|
|
[Route("api/[controller]")]
|
2022-07-30 20:00:31 +02:00
|
|
|
|
public class EventController : GenericControllerDTO<IEventService, Event, EventDTO>
|
2018-10-07 15:15:11 +02:00
|
|
|
|
{
|
2018-10-22 01:13:42 +02:00
|
|
|
|
private IGameService _gameService;
|
|
|
|
|
|
|
2022-07-30 20:00:31 +02:00
|
|
|
|
public EventController(IMapper mapper, IEventService service,IGameService gameService) : base(mapper,service)
|
2018-10-07 15:15:11 +02:00
|
|
|
|
{
|
2018-10-22 01:13:42 +02:00
|
|
|
|
this._gameService = gameService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-07-30 20:00:31 +02:00
|
|
|
|
|
|
|
|
|
|
public override List<EventDTO> Get()
|
|
|
|
|
|
{
|
|
|
|
|
|
return this._mapper.Map<List<EventDTO>>(_service.GetAll().OrderByDescending(e=>e.Date).ToList());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-10-07 15:15:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|