|
|
@ -1,4 +1,5 @@
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using apiLOL.DTO;
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Model;
|
|
|
|
using Model;
|
|
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
@ -23,10 +24,23 @@ namespace apiLOL.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GET api/<ControllerSkins>/5
|
|
|
|
// GET api/<ControllerSkins>/5
|
|
|
|
[HttpGet("{id}")]
|
|
|
|
[HttpGet]
|
|
|
|
public string Get(int id)
|
|
|
|
public async Task<IActionResult> Get([FromQuery] int index = 0, int count = 10, string? name = "")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return "value";
|
|
|
|
_logger.LogInformation($"methode Get de ControllerSkins appelée index:{index}, count: {count} et name:{name}");
|
|
|
|
|
|
|
|
int nbSkins = await data.SkinsMgr.GetNbItems();
|
|
|
|
|
|
|
|
_logger.LogInformation($"Nombre de skins : {nbSkins}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var skin = (await data.SkinsMgr.GetItems(index, await data.SkinsMgr.GetNbItems())).Select(Model => Model.ToDTO());//.Where(Model => Model.Name.Contains(name)).Skip(index * count).Take(count).Select(Model => Model.ToDTO());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var page = new SkinPageDTO
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Data = (IEnumerable<SkinDTO>)skin,
|
|
|
|
|
|
|
|
Index = index,
|
|
|
|
|
|
|
|
Count = count,
|
|
|
|
|
|
|
|
TotalCount = nbSkins
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
return Ok(page);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// POST api/<ControllerSkins>
|
|
|
|
// POST api/<ControllerSkins>
|
|
|
|