using AutoMapper;
using System.ComponentModel.DataAnnotations;
using Timeline.Controllers;
using Timeline.Models.Validation;
using Timeline.Services;
namespace Timeline.Models.Http
{
///
/// Request model for .
///
public class HttpUserPatchRequest
{
///
/// New username. Null if not change. Need to be administrator.
///
[Username]
public string? Username { get; set; }
///
/// New password. Null if not change. Need to be administrator.
///
[MinLength(1)]
public string? Password { get; set; }
///
/// New nickname. Null if not change. Need to be administrator to change other's.
///
[Nickname]
public string? Nickname { get; set; }
}
///
/// Request model for .
///
public class HttpCreateUserRequest
{
///
/// Username of the new user.
///
[Required, Username]
public string Username { get; set; } = default!;
///
/// Password of the new user.
///
[Required, MinLength(1)]
public string Password { get; set; } = default!;
}
///
/// Request model for .
///
public class HttpChangePasswordRequest
{
///
/// Old password.
///
[Required(AllowEmptyStrings = false)]
public string OldPassword { get; set; } = default!;
///
/// New password.
///
[Required(AllowEmptyStrings = false)]
public string NewPassword { get; set; } = default!;
}
public class HttpUserControllerModelAutoMapperProfile : Profile
{
public HttpUserControllerModelAutoMapperProfile()
{
CreateMap();
}
}
}