mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 10:46:33 +00:00
get resource works
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Azaion.Common.Entities;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Azaion.Common.Requests;
|
||||
|
||||
@@ -7,4 +8,16 @@ public class GetResourceRequest
|
||||
public string Password { get; set; } = null!;
|
||||
public string HardwareId { get; set; } = null!;
|
||||
public ResourceEnum ResourceEnum { get; set; }
|
||||
}
|
||||
|
||||
public class GetResourceRequestValidator : AbstractValidator<GetResourceRequest>
|
||||
{
|
||||
public GetResourceRequestValidator()
|
||||
{
|
||||
RuleFor(r => r.Password)
|
||||
.MinimumLength(8).WithErrorCode(ExceptionEnum.PasswordLengthIncorrect.ToString()).WithMessage("Password should be at least 8 characters.");
|
||||
|
||||
RuleFor(r => r.HardwareId)
|
||||
.NotEmpty().WithErrorCode(ExceptionEnum.HardwareIdMismatch.ToString()).WithMessage("Hardware Id should be not empty.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user