forked from ddrilling/AsbCloudServer
add attrib's -ProcessMap,permissions
and remove validators
This commit is contained in:
parent
9793280b28
commit
612fa19b10
@ -1,4 +1,6 @@
|
||||
namespace AsbCloudApp.Data
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace AsbCloudApp.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Разрешение для группы пользователей сделать что-либо через web-api. <br/>
|
||||
@ -12,11 +14,13 @@
|
||||
/// <summary>
|
||||
/// Название
|
||||
/// </summary>
|
||||
[StringLength(50, MinimumLength = 1)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Описание
|
||||
/// </summary>
|
||||
[StringLength(1024, MinimumLength = 1)]
|
||||
public string? Description { get; set; }
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace AsbCloudApp.Data.ProcessMap
|
||||
{
|
||||
@ -11,6 +12,7 @@ namespace AsbCloudApp.Data.ProcessMap
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
[Range(1,int.MaxValue)]
|
||||
public int IdWell { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@ -31,11 +33,13 @@ namespace AsbCloudApp.Data.ProcessMap
|
||||
/// <summary>
|
||||
/// Стартовая глубина
|
||||
/// </summary>
|
||||
[Range(0,50000)]
|
||||
public double DepthStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Глубина окончания интервала
|
||||
/// </summary>
|
||||
[Range(0, 50000)]
|
||||
public double DepthEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,16 +0,0 @@
|
||||
using AsbCloudApp.Data;
|
||||
using FluentValidation;
|
||||
|
||||
namespace AsbCloudInfrastructure.Validators
|
||||
{
|
||||
public class CompanyDtoValidator : AbstractValidator<CompanyDto>
|
||||
{
|
||||
public CompanyDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Caption).Length(1, 50)
|
||||
.WithMessage("Допустимое имя компании от 1 до 50 символов");
|
||||
RuleFor(x => x.CompanyTypeCaption).Length(1, 30)
|
||||
.WithMessage("Допустимое имя типа компании от 1 до 30 символов");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using AsbCloudApp.Data;
|
||||
using FluentValidation;
|
||||
|
||||
namespace AsbCloudInfrastructure.Validators
|
||||
{
|
||||
public class PermissionDtoValidator : AbstractValidator<PermissionDto>
|
||||
{
|
||||
public PermissionDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Name).Length(1, 50)
|
||||
.WithMessage("Допустимая длина названия разрешения от 1 до 50 символов");
|
||||
RuleFor(x => x.Description).Length(1, 1024)
|
||||
.WithMessage("Допустимая длина описания от 1 до 1024 символов");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
using AsbCloudApp.Data.ProcessMap;
|
||||
using FluentValidation;
|
||||
|
||||
namespace AsbCloudInfrastructure.Validators
|
||||
{
|
||||
public class ProcessMapValidator : AbstractValidator<ProcessMapDto>
|
||||
{
|
||||
public ProcessMapValidator()
|
||||
{
|
||||
RuleFor(x => x.IdWell).GreaterThan(0)
|
||||
.WithMessage("Id скважины не может быть меньше 1");
|
||||
RuleFor(x => x.DepthStart).GreaterThan(-1)
|
||||
.WithMessage("Глубина не может быть отрицательной");
|
||||
RuleFor(x => x.DepthEnd).GreaterThan(-1)
|
||||
.WithMessage("Глубина не может быть отрицательной");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user