1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-16 19:55:36 +01:00
GiantsTools/Giants.WebApi/Controllers/VersionController.cs

32 lines
869 B
C#
Raw Normal View History

using System.Threading.Tasks;
using AutoMapper;
using Giants.Services;
using Microsoft.AspNetCore.Mvc;
namespace Giants.WebApi.Controllers
{
[ApiController]
[Route("api/[controller]")]
public class VersionController : ControllerBase
{
private readonly IMapper mapper;
private readonly IUpdaterService updaterService;
public VersionController(
IMapper mapper,
IUpdaterService updaterService)
{
this.mapper = mapper;
this.updaterService = updaterService;
}
[HttpGet]
2020-08-16 11:03:10 +02:00
public async Task<DataContract.V1.VersionInfo> GetVersionInfo(string appName)
{
Services.VersionInfo versionInfo = await this.updaterService.GetVersionInfo(appName);
2020-08-16 11:03:10 +02:00
return mapper.Map<DataContract.V1.VersionInfo>(versionInfo);
}
}
}