using DomainResults.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WeatherForecast.Models.Requests;
using WeatherForecast.Services;
namespace WeatherForecast.Controllers;
/// 
/// 
/// 
[AllowAnonymous]
[ApiController]
[Route("api/[controller]")]
public class AuthenticationController : ControllerBase {
  private readonly IAuthenticationService _authenticationService;
  /// 
  /// 
  /// 
  /// 
  public AuthenticationController(
    IAuthenticationService authenticationService
  ) {
    _authenticationService = authenticationService;
  }
  /// 
  /// 
  /// 
  /// 
  /// 
  /// 
  [HttpPost("{siteId}")]
  public IActionResult Post([FromRoute] Guid siteId, [FromBody] AuthenticationRequestModel requestData) {
    var result = _authenticationService.Post(siteId, requestData);
    return result.ToActionResult();
  }
}