You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.6 KiB
51 lines
1.6 KiB
using API.Dto;
|
|
using EFManager;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Model;
|
|
|
|
namespace API.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class SkinController
|
|
{
|
|
|
|
private readonly ManagerData data;
|
|
|
|
private readonly ILogger<SkinController> _logger;
|
|
|
|
public SkinController(ManagerData manager, ILogger<SkinController> logger)
|
|
{
|
|
data = manager;
|
|
_logger = logger;
|
|
}
|
|
|
|
/*
|
|
[HttpGet("{Name}/Skins")]
|
|
public async Task<ActionResult<SkinDto>> GetSkinsChamp(string name)
|
|
{
|
|
// Récupération de la liste des champions
|
|
IEnumerable<Champion?> Champs = await data.ChampionsMgr.GetItemsByName(name, await data.ChampionsMgr.GetNbItemsByName(name), 1);
|
|
|
|
// Récupération du champion correspondant à l'id
|
|
//if (await data.ChampionsMgr.GetNbItemsByName(name).Result)
|
|
{
|
|
// Converstion en Champion au lieu de champion IEnumerable
|
|
Champion champion = Champs.First();
|
|
|
|
// Récupération des skin du champion
|
|
IEnumerable<Skin?> Skins = await data.SkinsMgr.GetItemsByChampion(champion, 0, data.SkinsMgr.GetNbItemsByChampion(champion).Result);
|
|
|
|
// Création de la liste de skin
|
|
List<SkinDto> skins = new List<SkinDto>();
|
|
|
|
// Ajout des skins dans la nouvelle liste
|
|
Skins.ToList().ForEach(Skin => skins.Add(Skin.ToDto()));
|
|
|
|
return Ok(skins);
|
|
}
|
|
return BadRequest();
|
|
}*/
|
|
}
|
|
}
|