|
|
@ -1,31 +1,44 @@
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
using Model;
|
|
|
|
using StubLib;
|
|
|
|
using StubLib;
|
|
|
|
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|
|
|
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|
|
|
|
|
|
|
|
|
|
|
namespace apiLOL.Controllers
|
|
|
|
namespace apiLOL.Controllers
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
|
|
|
|
[ApiController]
|
|
|
|
[ApiController]
|
|
|
|
public class ControllerChampions : ControllerBase
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
|
|
|
|
public class ControllerChampions : Controller
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public StubData.ChampionsManager ChampionsManager { get; set; }
|
|
|
|
private readonly IDataManager data;
|
|
|
|
|
|
|
|
//public StubData.ChampionsManager ChampionsManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ControllerChampions(IDataManager manager)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
// GET: api/<ControllerLol>
|
|
|
|
data = manager;
|
|
|
|
[HttpGet]
|
|
|
|
}
|
|
|
|
public IEnumerable<string> Get()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GET: api/<ControllerLol>
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
|
|
public async Task<IActionResult> Get()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new string[] { "value1", "value2" };
|
|
|
|
var champs = (await data.ChampionsMgr.GetItems(0, await data.ChampionsMgr.GetNbItems())).Select(Model => Model.ToDTO());
|
|
|
|
|
|
|
|
return Ok(champs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GET api/<ControllerLol>/5
|
|
|
|
// GET api/<ControllerLol>/5
|
|
|
|
[HttpGet("{id}")]
|
|
|
|
[HttpGet("{id}")]
|
|
|
|
public string Get(int id)
|
|
|
|
public async Task<IActionResult> Get(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ChampionsManager.GetNbItemsByCharacteristic("Akali");
|
|
|
|
//ChampionsManager.GetNbItemsByCharacteristic("Akali");
|
|
|
|
ChampionMapper.ToDTO(ChampionsManager.GetNbItemsByCharacteristic("Akali"));
|
|
|
|
//ChampionMapper.ToDTO(ChampionsManager.GetNbItemsByCharacteristic("Akali"));
|
|
|
|
//return new ChampionMapper.ToDTO(ChampionsManager.GetNbItemsByCharacteristic("Akali"));
|
|
|
|
//return new ChampionMapper.ToDTO(ChampionsManager.GetNbItemsByCharacteristic("Akali"));
|
|
|
|
return "value";
|
|
|
|
//return "value";
|
|
|
|
|
|
|
|
var champs = (await data.ChampionsMgr.GetItems(0, await data.ChampionsMgr.GetNbItems())).Select(Model => Model.ToDTO());
|
|
|
|
|
|
|
|
return Ok(champs);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// POST api/<ControllerLol>
|
|
|
|
// POST api/<ControllerLol>
|
|
|
|