From ea67db0b2971271612a2fdf9631b1fe4d6ca7e07 Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Sat, 24 Aug 2019 22:24:04 +0800 Subject: Rename EMail to Email. --- Timeline/Entities/UserDetail.cs | 2 +- Timeline/Models/UserDetail.cs | 6 ++++-- Timeline/Services/UserDetailService.cs | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'Timeline') diff --git a/Timeline/Entities/UserDetail.cs b/Timeline/Entities/UserDetail.cs index 6e582234..bc14dbe6 100644 --- a/Timeline/Entities/UserDetail.cs +++ b/Timeline/Entities/UserDetail.cs @@ -16,7 +16,7 @@ namespace Timeline.Entities public string QQ { get; set; } [Column("email"), MaxLength(50)] - public string EMail { get; set; } + public string Email { get; set; } [Column("phone_number"), MaxLength(15)] public string PhoneNumber { get; set; } diff --git a/Timeline/Models/UserDetail.cs b/Timeline/Models/UserDetail.cs index 86866d8b..1a6c0c6a 100644 --- a/Timeline/Models/UserDetail.cs +++ b/Timeline/Models/UserDetail.cs @@ -1,6 +1,7 @@ using System.ComponentModel.DataAnnotations; using Timeline.Entities; using Timeline.Models.Validation; +using Newtonsoft.Json; namespace Timeline.Models { @@ -10,10 +11,11 @@ namespace Timeline.Models public string Nickname { get; set; } [ValidateWith(typeof(UserDetailValidators.QQValidator))] + [JsonProperty(PropertyName = "qq")] public string QQ { get; set; } [ValidateWith(typeof(UserDetailValidators.EMailValidator))] - public string EMail { get; set; } + public string Email { get; set; } [ValidateWith(typeof(UserDetailValidators.PhoneNumberValidator))] public string PhoneNumber { get; set; } @@ -34,7 +36,7 @@ namespace Timeline.Models { Nickname = CoerceEmptyToNull(entity.Nickname), QQ = CoerceEmptyToNull(entity.QQ), - EMail = CoerceEmptyToNull(entity.EMail), + Email = CoerceEmptyToNull(entity.Email), PhoneNumber = CoerceEmptyToNull(entity.PhoneNumber), Description = CoerceEmptyToNull(entity.Description) }; diff --git a/Timeline/Services/UserDetailService.cs b/Timeline/Services/UserDetailService.cs index a8ed662b..5e049435 100644 --- a/Timeline/Services/UserDetailService.cs +++ b/Timeline/Services/UserDetailService.cs @@ -111,8 +111,8 @@ namespace Timeline.Services if (detail.QQ != null) detailEntity.QQ = detail.QQ; - if (detail.EMail != null) - detailEntity.EMail = detail.EMail; + if (detail.Email != null) + detailEntity.Email = detail.Email; if (detail.PhoneNumber != null) detailEntity.PhoneNumber = detail.PhoneNumber; -- cgit v1.2.3