mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 08:56:33 +00:00
get resource works
This commit is contained in:
@@ -2,6 +2,7 @@ namespace Azaion.Common.Entities;
|
||||
|
||||
public enum ResourceEnum
|
||||
{
|
||||
None = 0,
|
||||
AnnotatorDll = 10,
|
||||
AIModelRKNN = 20,
|
||||
AIModelONNX = 30,
|
||||
|
||||
@@ -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