From 57151c879376374425adb04fb68dad2cf7930df8 Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Mon, 5 Aug 2019 18:58:56 +0800 Subject: 3 things. 1. Exchange Models and Entities namespace. 2. Fix the bug that input with missing field leads to 500. 3. Write unit tests. --- Timeline/Models/Http/User.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Timeline/Models/Http/User.cs (limited to 'Timeline/Models/Http/User.cs') diff --git a/Timeline/Models/Http/User.cs b/Timeline/Models/Http/User.cs new file mode 100644 index 00000000..1de7fae2 --- /dev/null +++ b/Timeline/Models/Http/User.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; + +namespace Timeline.Models.Http +{ + public class UserPutRequest + { + [Required] + public string Password { get; set; } + [Required] + public bool Administrator { get; set; } + } + + public class UserPatchRequest + { + public string Password { get; set; } + public bool? Administrator { get; set; } + } + + public class ChangePasswordRequest + { + [Required] + public string OldPassword { get; set; } + [Required] + public string NewPassword { get; set; } + } +} -- cgit v1.2.3