Fase 1: Inicialización del Backend .NET 10, Configuración de Dapper, Autenticación JWT y Entidades Base

This commit is contained in:
2025-12-17 13:08:21 -03:00
parent 15305c681c
commit eda016f93f
33 changed files with 819 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Mvc;
using SIGCM.Application.DTOs;
using SIGCM.Application.Interfaces;
namespace SIGCM.API.Controllers;
[ApiController]
[Route("api/[controller]")]
public class AuthController : ControllerBase
{
private readonly IAuthService _authService;
public AuthController(IAuthService authService)
{
_authService = authService;
}
[HttpPost("login")]
public async Task<IActionResult> Login(LoginDto dto)
{
var token = await _authService.LoginAsync(dto.Username, dto.Password);
if (token == null) return Unauthorized("Invalid credentials");
return Ok(new { token });
}
}