46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using DomainResults.Mvc;
|
|
|
|
using WeatherForecast.Services;
|
|
using Core.Enumerations;
|
|
|
|
namespace WeatherForecast.Controllers;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route("api/[controller]")]
|
|
public class ContentController : ControllerBase {
|
|
|
|
private readonly IAuthorizationService _authorizationService;
|
|
private readonly IContentService _contentService;
|
|
|
|
private readonly WebapiControllers _webapiController = WebapiControllers.Content;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="authorizationService"></param>
|
|
/// <param name="contentService"></param>
|
|
public ContentController(
|
|
IAuthorizationService authorizationService,
|
|
IContentService contentService
|
|
) {
|
|
_authorizationService = authorizationService;
|
|
_contentService = contentService;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet("{siteId}")]
|
|
public IActionResult Get([FromRoute] Guid siteId, [FromQuery] string? locale) {
|
|
var result = _contentService.GetContent(siteId, locale ?? "en-US") ;
|
|
return result.ToActionResult();
|
|
}
|
|
}
|