From abde51b167f17301c25e32ae247e7909c0dc9367 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 29 Jan 2020 23:13:15 +0800 Subject: ... --- Timeline/Models/Http/UserController.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Timeline/Models/Http/UserController.cs (limited to 'Timeline/Models/Http/UserController.cs') diff --git a/Timeline/Models/Http/UserController.cs b/Timeline/Models/Http/UserController.cs new file mode 100644 index 00000000..229ca1e5 --- /dev/null +++ b/Timeline/Models/Http/UserController.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; +using Timeline.Models.Validation; + +namespace Timeline.Models.Http +{ + public class UserPatchRequest + { + [Username] + public string? Username { get; set; } + + [MinLength(1)] + public string? Password { get; set; } + + [Nickname] + public string? Nickname { get; set; } + + public bool? Administrator { get; set; } + } + + public class ChangePasswordRequest + { + [Required(AllowEmptyStrings = false)] + public string OldPassword { get; set; } = default!; + [Required(AllowEmptyStrings = false)] + public string NewPassword { get; set; } = default!; + } +} -- cgit v1.2.3