添加项目文件。
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace IdentityService.WebApi.Controllers.Auth
|
||||
{
|
||||
public class RegisterRequest
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string NickName { get; set; }
|
||||
}
|
||||
public class RegisterRequestValidator : AbstractValidator<RegisterRequest>
|
||||
{
|
||||
public RegisterRequestValidator()
|
||||
{
|
||||
RuleFor(r => r.UserName)
|
||||
.NotEmpty()
|
||||
.NotNull()
|
||||
.MaximumLength(20)
|
||||
.MinimumLength(5);
|
||||
|
||||
RuleFor(r => r.Password)
|
||||
.NotEmpty()
|
||||
.NotNull()
|
||||
.MinimumLength(6)
|
||||
.MaximumLength(50);
|
||||
|
||||
RuleFor(r => r.NickName)
|
||||
.NotEmpty()
|
||||
.NotNull()
|
||||
.MaximumLength(50);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user