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
commitabde51b167f17301c25e32ae247e7909c0dc9367 (patch)
treec9131a7b95fffd64bf2c26527d7f62fbdefa7e2c /Timeline/Models/Http/UserController.cs
parent81c261b59016e15d320ad963882afe4d9c7b5f7d (diff)
downloadtimeline-abde51b167f17301c25e32ae247e7909c0dc9367.tar.gz
timeline-abde51b167f17301c25e32ae247e7909c0dc9367.tar.bz2
timeline-abde51b167f17301c25e32ae247e7909c0dc9367.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!;
+ }
+}