Fix challonge event

Fix GenericController
Fix ChallongeSave.
Fix RestAPI in prod mode.
This commit is contained in:
2022-07-30 20:00:31 +02:00
parent 715caa74b2
commit 0173070ba4
9 changed files with 56 additions and 44 deletions

View File

@@ -2,7 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
using LaDOSE.Business.Interface;
using LaDOSE.DTO;
using LaDOSE.Entity;
using LaDOSE.Entity.Wordpress;
using Microsoft.AspNetCore.Authorization;
@@ -11,19 +13,24 @@ using Microsoft.AspNetCore.Mvc;
namespace LaDOSE.Api.Controllers
{
[AllowAnonymous]
//[Authorize]
[Produces("application/json")]
[Route("api/[controller]")]
public class EventController : GenericController<IEventService, Event>
public class EventController : GenericControllerDTO<IEventService, Event, EventDTO>
{
private IGameService _gameService;
public EventController(IEventService service,IGameService gameService) : base(service)
public EventController(IMapper mapper, IEventService service,IGameService gameService) : base(mapper,service)
{
this._gameService = gameService;
}
public override List<EventDTO> Get()
{
return this._mapper.Map<List<EventDTO>>(_service.GetAll().OrderByDescending(e=>e.Date).ToList());
}
}
}