using Newtonsoft.Json; using Swashbuckle.AspNetCore.Annotations; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FlexJobApi.Core { /// /// 百度文字识别结果 /// public class BaiduOcrIdentityFrontResult { /// /// 地址 /// public string Url { get; set; } /// /// 模型 /// public BaiduOcrIdentityFrontResultModel Model { get; set; } /// /// 错误码 /// [JsonProperty("error_code")] public string ErrorCode { get; set; } /// /// 错误消息 /// [JsonProperty("error_msg")] public string ErrorMessage { get; set; } /// /// 文字结果 /// [JsonProperty("words_result")] public Dictionary WordsResult { get; set; } } /// /// 百度文字识别结果 /// public class BaiduOcrIdentityFrontResultModel { /// /// /// 姓名 /// public string Name { get; set; } /// /// 身份证号 /// public string Identity { get; set; } /// /// 性别 /// [JsonIgnore, SwaggerIgnore] public string GenderText { get; set; } /// /// 性别 /// public EnumUserGender? Gender => GenderText == "男" ? EnumUserGender.Male : GenderText == "女" ? EnumUserGender.Female : null; /// /// 生日 /// [JsonIgnore, SwaggerIgnore] public string BirthdayText { get; set; } /// /// 生日 /// public DateTime? Birthday => BirthdayText?.ToDateTime("yyyyMMdd"); /// /// 民族 /// public string Nation { get; set; } /// /// 住址 /// public string Address { get; set; } } }