58 lines
1.6 KiB
C#
58 lines
1.6 KiB
C#
|
|
|||
|
|
|||
|
namespace ZhiYi.Core.Api.Controllers
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 用户管理
|
|||
|
/// </summary>
|
|||
|
[Route("api/user/[action]")]
|
|||
|
[ApiController]
|
|||
|
public class UserController : ControllerBase
|
|||
|
{
|
|||
|
private readonly IUserAppService _userAppService;
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
/// <param name="userAppService"></param>
|
|||
|
public UserController(IUserAppService userAppService)
|
|||
|
{
|
|||
|
_userAppService = userAppService;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 验证码登录
|
|||
|
/// </summary>
|
|||
|
/// <param name="input"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public async Task<ActionResult<LoginResponseDto>> LoginAsync([FromBody] UserLoginDto input)
|
|||
|
=> await _userAppService.LoginAsync(input);
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 注册
|
|||
|
/// </summary>
|
|||
|
/// <param name="input"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public async Task RegisterAsync([FromBody] UserCreationDto input)
|
|||
|
=> await _userAppService.RegisterAsync(input);
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 用户列表
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpGet]
|
|||
|
public async Task<ActionResult<object>> UserList()
|
|||
|
=> await _userAppService.GetUserAsync();
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取签名
|
|||
|
/// </summary>
|
|||
|
/// <param name="input"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public async Task<ActionResult<string>> GetSignature([FromBody]SignatureCreationDto input)
|
|||
|
=> await _userAppService.GetSignature(input);
|
|||
|
}
|
|||
|
}
|