Files
2023-12-05 20:21:21 +02:00

33 lines
703 B
C#

namespace MyOffice.Web.Controllers;
using AutoMapper;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Models.Currency;
using Services.Currency;
using MyOffice.Web.Infrastructure.Attributes;
[Authorize]
[DefaultFromBody]
public class GeneralController : BaseApiController
{
private readonly CurrencyService _currencyService;
private readonly IMapper _mapper;
public GeneralController(
CurrencyService currencyService,
IMapper mapper
)
{
_currencyService = currencyService;
_mapper = mapper;
}
public ObjectResult GetGlobalCurrencies()
{
var list = _currencyService.GetGlobalAll();
return Ok(_mapper.Map<List<CurrencyGlobalViewModel>>(list));
}
}