diff options
author | 杨宇千 <crupest@outlook.com> | 2019-08-17 20:43:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-17 20:43:24 +0800 |
commit | 2d672de8ea109c923d5a8697e44d5cbbf976ead2 (patch) | |
tree | cecc5b93150f7b1e3be792de5c058433b5e40982 /Timeline/Models/Http/User.cs | |
parent | 7bbd66270597c7f6f07f1ab5ec6c45b3dcfa388e (diff) | |
parent | 67f42c40c3d4108620119e163a67f2686dd4a6f2 (diff) | |
download | timeline-2d672de8ea109c923d5a8697e44d5cbbf976ead2.tar.gz timeline-2d672de8ea109c923d5a8697e44d5cbbf976ead2.tar.bz2 timeline-2d672de8ea109c923d5a8697e44d5cbbf976ead2.zip |
Merge pull request #42 from crupest/change-username
Add change username api.
Diffstat (limited to 'Timeline/Models/Http/User.cs')
-rw-r--r-- | Timeline/Models/Http/User.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Timeline/Models/Http/User.cs b/Timeline/Models/Http/User.cs index d45543fb..4308a19c 100644 --- a/Timeline/Models/Http/User.cs +++ b/Timeline/Models/Http/User.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations;
+using Timeline.Models.Validation;
namespace Timeline.Models.Http
{
@@ -16,6 +17,15 @@ namespace Timeline.Models.Http public bool? Administrator { get; set; }
}
+ public class ChangeUsernameRequest
+ {
+ [Required]
+ public string OldUsername { get; set; }
+
+ [Required, ValidateWith(typeof(UsernameValidator))]
+ public string NewUsername { get; set; }
+ }
+
public class ChangePasswordRequest
{
[Required]
|