using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Serwer.Infrastructure.Services; using System; using System.Threading.Tasks; namespace Serwer.Api.Controllers { [Route("api/[controller]")] [ApiController] public class HistoryController: ControllerBase { private readonly IHistoryService _historyService; public HistoryController(IHistoryService historyService) { _historyService = historyService; } [Authorize] [HttpGet()] public async Task Get() { var id = User.Identity.Name; var history = await _historyService.GetAsync(Guid.Parse(id)); return Ok(history); } } }