using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Swashbuckle.AspNetCore.Annotations; using SPMS.Application.DTOs.Auth; using SPMS.Application.Interfaces; using SPMS.Domain.Common; namespace SPMS.API.Controllers; [ApiController] [Route("v1/in/auth")] [ApiExplorerSettings(GroupName = "auth")] public class AuthController : ControllerBase { private readonly IAuthService _authService; public AuthController(IAuthService authService) { _authService = authService; } [HttpPost("login")] [AllowAnonymous] [SwaggerOperation( Summary = "관리자 로그인", Description = "이메일과 비밀번호로 로그인하여 JWT 토큰을 발급받습니다.")] [SwaggerResponse(200, "로그인 성공", typeof(ApiResponse))] [SwaggerResponse(401, "로그인 실패")] public async Task LoginAsync([FromBody] LoginRequestDto request) { var result = await _authService.LoginAsync(request); return Ok(ApiResponse.Success(result)); } }