using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using DomainResults.Mvc;
using WeatherForecast.Services;
namespace WeatherForecast.Controllers;
///
///
///
[ApiController]
[Route("api/[controller]")]
public class ContentController : ControllerBase {
private readonly IAuthorizationService _authorizationService;
private readonly IContentService _contentService;
///
///
///
///
///
public ContentController(
IAuthorizationService authorizationService,
IContentService contentService
) {
_authorizationService = authorizationService;
_contentService = contentService;
}
#region Authless methods
///
///
///
///
[HttpGet("{siteId}")]
public IActionResult Get([FromRoute] Guid siteId, [FromQuery] string? locale) {
var result = _contentService.GetContent(siteId, locale ?? "en-US") ;
return result.ToActionResult();
}
#endregion
}