feat 人脸上传,内部支持客户端授权

This commit is contained in:
2024-01-11 19:38:23 +08:00
parent d35b0043c3
commit 15e90d4d16
15 changed files with 243 additions and 14 deletions

View File

@@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
namespace Dlhis.Basic.Organization.Request;
public class GainfoUploadFaceRequest : IValidatableObject
{
/// <summary>
/// 用户档案号
/// </summary>
[Required(ErrorMessage = "用户档案号")]
public string UserNo { get; set; }
/// <summary>
/// 人脸照片
/// </summary>
[Required(ErrorMessage = "人脸照片不能为空")]
public string Face { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
bool v = true;
try
{
Convert.FromBase64String(Face);
}
catch (Exception)
{
v = false;
}
if (!v)
{
yield return new ValidationResult("人脸照片需要为Base64格式", new[] { nameof(Face) });
}
}
}