123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using FluentValidation;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace OASystem.Domain.Dtos.Tencent
- {
-
-
-
- public class OCRDtoBase
- {
-
-
-
- public string picBase64 { get; set; }
-
-
-
-
-
- public int language { get; set; }
- }
-
-
-
- public class OCRDtoBaseFoalidator : AbstractValidator<OCRDtoBase>
- {
- public OCRDtoBaseFoalidator()
- {
- RuleFor(it => it.picBase64)
- .NotEmpty()
- .NotNull()
- .WithMessage("picBase64为空");
- RuleFor(it => it.picBase64)
- .Must(base64 => OCRVerifyMethod.ImageSize(base64))
- .WithMessage("图片不能大于7M!");
-
-
-
- RuleFor(it => it.language)
- .InclusiveBetween(1, 2)
- .WithMessage("language(超出范围):1 中文 2 英文");
- }
- }
- }
|