27 lines
654 B
C#
27 lines
654 B
C#
using AI.Common.Dtos;
|
|
using AI.Common.Services.Interface;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace AI.Api.Controllers
|
|
{
|
|
[Route("[controller]")]
|
|
public class AuthController : BaseController
|
|
{
|
|
private readonly IAuthService _authService;
|
|
|
|
public AuthController(IAuthService authService)
|
|
{
|
|
this._authService = authService;
|
|
}
|
|
|
|
|
|
[AllowAnonymous]
|
|
[HttpPost("login")]
|
|
public async Task<IActionResult> LoginAsync([FromBody] LoginDto loginDto)
|
|
{
|
|
return Ok(await _authService.LoginAsync(loginDto));
|
|
}
|
|
}
|
|
}
|