16 lines
545 B
C#
16 lines
545 B
C#
using FluentValidation;
|
|
using Heimdall.Application.DTOs;
|
|
|
|
namespace Heimdall.Application.Validators;
|
|
|
|
public class CreateCameraValidator : AbstractValidator<CreateCameraRequest>
|
|
{
|
|
public CreateCameraValidator()
|
|
{
|
|
RuleFor(x => x.Name).NotEmpty().MaximumLength(200);
|
|
RuleFor(x => x.RtspUrl).NotEmpty().Must(uri => Uri.TryCreate(uri, UriKind.Absolute, out _))
|
|
.WithMessage("L'URL RTSP doit être une URI absolue valide (ex. rtsp://192.168.1.100:554/stream1)");
|
|
RuleFor(x => x.SiteId).NotEmpty();
|
|
}
|
|
}
|