TourIAm/TIAMWebApp/Server/Controllers/TransferDataAPIController.cs

37 lines
2.4 KiB
C#

using Microsoft.AspNetCore.Mvc;
using System.Reflection.Metadata;
using TIAMWebApp.Shared.Application.Models;
namespace TIAMWebApp.Server.Controllers
{
[ApiController]
[Route("[controller]")]
public class TransferDataAPIController : ControllerBase
{
private static readonly TransferDestination[] Names = new TransferDestination[]
{
/*"Castle of Buda", "Hungarian National Museum", "Parliament of Hungary", "Heroes square", "Gellert Hill", "Margaret Island"*/
new() { DestinationId = 1, DestinationName = "Airport", DestinationDescription = "International airport of Budapest", DestinationLatitude = 42.234444f, DestinationLongitude = 39.100010f },
new() { DestinationId = 2, DestinationName = "Castle of Buda", DestinationDescription = "International airport of Budapest", DestinationLatitude = 42.234444f, DestinationLongitude = 39.100010f },
new() { DestinationId = 3, DestinationName = "Hungarian National Museum", DestinationDescription = "International airport of Budapest", DestinationLatitude = 42.234444f, DestinationLongitude = 39.100010f },
new() { DestinationId = 4, DestinationName = "Parliament of Hungary", DestinationDescription = "International airport of Budapest", DestinationLatitude = 42.234444f, DestinationLongitude = 39.100010f },
new() { DestinationId = 5, DestinationName = "Heroes square", DestinationDescription = "International airport of Budapest", DestinationLatitude = 42.234444f, DestinationLongitude = 39.100010f },
new() { DestinationId = 6, DestinationName = "Gellert Hill", DestinationDescription = "International airport of Budapest", DestinationLatitude = 42.234444f, DestinationLongitude = 39.100010f },
new() { DestinationId = 6, DestinationName = "Margaret Island", DestinationDescription = "International airport of Budapest", DestinationLatitude = 42.234444f, DestinationLongitude = 39.100010f }
};
private readonly ILogger<TransferDataAPIController> _logger;
public TransferDataAPIController(ILogger<TransferDataAPIController> logger)
{
_logger = logger;
}
[HttpGet]
public IEnumerable<TransferDestination> Get()
{
return Enumerable.Range(1, 5).Select(index => Names[Random.Shared.Next(Names.Length)]).ToArray();
}
}
}