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.
34 lines
709 B
34 lines
709 B
using Dto.Factories;
|
|
using Interface;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Modele.Classe;
|
|
|
|
namespace Api.Controllers
|
|
{
|
|
[Route("[controller]")]
|
|
[ApiController]
|
|
public class Points : Controller
|
|
{
|
|
private readonly IApi data;
|
|
|
|
public Points(IApi manager)
|
|
{
|
|
this.data = manager;
|
|
}
|
|
|
|
[HttpGet]
|
|
public async Task<IActionResult> Get(long IdTour)
|
|
{
|
|
IEnumerable<Point> points = (await data.GetPoints(IdTour));
|
|
if (points == null)
|
|
{
|
|
return BadRequest();
|
|
}
|
|
return Ok(points.Select(e => e.ModeleToDTO()));
|
|
|
|
}
|
|
|
|
}
|
|
}
|