24 lines
624 B
C#
24 lines
624 B
C#
using Application;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
namespace WebApi.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("api/[controller]/[action]")]
|
|
public class AuthController(
|
|
IAuthApplication authApplication,
|
|
ILogger<AuthController> logger) : ControllerBase
|
|
{
|
|
/// <summary>
|
|
/// 用户登录
|
|
/// </summary>
|
|
[AllowAnonymous]
|
|
[HttpPost]
|
|
public BaseResponse<Application.Dto.LoginResponse> Login([FromBody] Application.Dto.LoginRequest request)
|
|
{
|
|
var response = authApplication.Login(request);
|
|
logger.LogInformation("用户登录成功");
|
|
return response.Ok();
|
|
}
|
|
}
|