aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Models/Http/UserController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-01-29 23:13:15 +0800
committercrupest <crupest@outlook.com>2020-01-29 23:13:15 +0800
commitdd0097af5c4ccbe25a1faca2286d729c93fd4116 (patch)
treec9131a7b95fffd64bf2c26527d7f62fbdefa7e2c /Timeline/Models/Http/UserController.cs
parent401a0c86054711bf5ebdce7d7717c9b59bffc2fa (diff)
downloadtimeline-dd0097af5c4ccbe25a1faca2286d729c93fd4116.tar.gz
timeline-dd0097af5c4ccbe25a1faca2286d729c93fd4116.tar.bz2
timeline-dd0097af5c4ccbe25a1faca2286d729c93fd4116.zip
...
Diffstat (limited to 'Timeline/Models/Http/UserController.cs')
-rw-r--r--Timeline/Models/Http/UserController.cs27
1 files changed, 27 insertions, 0 deletions
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!;
+ }
+}