using Core.Abstractions;
using Core.Enumerations;
using DomainResults.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WeatherForecast.Models.Requests;
using WeatherForecast.Services;
namespace WeatherForecast.Controllers {
///
///
///
[ApiController]
[AllowAnonymous]
[Route("api/[controller]")]
public class ShopCartItemsController : ControllerBase {
private readonly ILogger _logger;
private readonly IShopCartItemsService _shopCartItemsService;
///
///
///
///
public ShopCartItemsController(
ILogger logger,
IShopCartItemsService shopCartItemsService
) {
_logger = logger;
_shopCartItemsService = shopCartItemsService;
}
///
///
///
///
[HttpGet("{siteId}/{userId}")]
public IActionResult Get([FromRoute] Guid siteId, [FromRoute] Guid userId, [FromQuery] string locale) {
var result = _shopCartItemsService.Get(siteId, userId, Enumeration.FromDisplayName(locale) ?? Locales.Us);
return result.ToActionResult();
}
}
}