2018-10-04 21:13:32 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2020-09-13 22:50:52 +02:00
|
|
|
|
using AutoMapper;
|
2018-10-06 14:16:42 +02:00
|
|
|
|
using LaDOSE.Business.Interface;
|
2019-03-12 22:23:38 +01:00
|
|
|
|
using LaDOSE.DTO;
|
2018-10-05 00:18:37 +02:00
|
|
|
|
using LaDOSE.Entity;
|
2018-10-06 13:05:38 +02:00
|
|
|
|
using LaDOSE.Entity.Context;
|
2018-10-05 01:51:23 +02:00
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2018-10-04 21:13:32 +02:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
|
|
namespace LaDOSE.Api.Controllers
|
|
|
|
|
|
{
|
2018-10-05 01:51:23 +02:00
|
|
|
|
[Authorize]
|
2018-10-04 21:13:32 +02:00
|
|
|
|
[Route("api/[controller]")]
|
2018-10-06 02:05:00 +02:00
|
|
|
|
[Produces("application/json")]
|
2019-03-12 22:23:38 +01:00
|
|
|
|
public class GameController : GenericControllerDTO<IGameService, Game, GameDTO>
|
2018-10-04 21:13:32 +02:00
|
|
|
|
{
|
2024-03-22 23:58:43 +01:00
|
|
|
|
private IExternalProviderService provider;
|
|
|
|
|
|
public GameController(IMapper mapper,IGameService service, IExternalProviderService service2) : base(mapper,service)
|
2018-10-06 14:16:42 +02:00
|
|
|
|
{
|
2024-03-22 23:58:43 +01:00
|
|
|
|
provider = service2;
|
|
|
|
|
|
}
|
|
|
|
|
|
[HttpGet("smash/{name}")]
|
|
|
|
|
|
public async Task<List<GameDTO>> GetIdFromSmash(string name)
|
|
|
|
|
|
{
|
|
|
|
|
|
var smashGame = await provider.GetSmashGame(name);
|
|
|
|
|
|
|
|
|
|
|
|
return _mapper.Map<List<GameDTO>>(smashGame);;
|
2018-10-04 21:13:32 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|