AdminController.cs 851 B

123456789101112131415161718192021222324252627282930
  1. using Microsoft.AspNetCore.Http;
  2. using Microsoft.AspNetCore.Identity;
  3. using Microsoft.AspNetCore.Mvc;
  4. using MTWorkHR.Application.Filters;
  5. using MTWorkHR.Application.Identity;
  6. using MTWorkHR.Application.Models;
  7. using MTWorkHR.Core.Global;
  8. using MTWorkHR.Identity.Services;
  9. namespace MTWorkHR.API.Controllers
  10. {
  11. [Route("api/[controller]")]
  12. [ApiController]
  13. public class AdminController : ControllerBase
  14. {
  15. private readonly IAuthService _authenticationService;
  16. public AdminController(IAuthService authenticationService)
  17. {
  18. _authenticationService = authenticationService;
  19. }
  20. [HttpPost("login")]
  21. public async Task<ActionResult<AuthResponse>> Login(AuthRequest request)
  22. {
  23. return Ok( await _authenticationService.AdminLogin(request));
  24. }
  25. }
  26. }