From 79ab2b304d93b1029515bd3f954db4e5a73f4168 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 30 Jan 2020 20:26:52 +0800 Subject: ... --- Timeline/Models/Http/UserController.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'Timeline/Models/Http/UserController.cs') diff --git a/Timeline/Models/Http/UserController.cs b/Timeline/Models/Http/UserController.cs index 229ca1e5..e4c95cbd 100644 --- a/Timeline/Models/Http/UserController.cs +++ b/Timeline/Models/Http/UserController.cs @@ -1,5 +1,7 @@ +using AutoMapper; using System.ComponentModel.DataAnnotations; using Timeline.Models.Validation; +using Timeline.Services; namespace Timeline.Models.Http { @@ -17,6 +19,21 @@ namespace Timeline.Models.Http public bool? Administrator { get; set; } } + public class CreateUserRequest + { + [Required, Username] + public string Username { get; set; } = default!; + + [Required, MinLength(1)] + public string Password { get; set; } = default!; + + [Required] + public bool? Administrator { get; set; } + + [Nickname] + public string? Nickname { get; set; } + } + public class ChangePasswordRequest { [Required(AllowEmptyStrings = false)] @@ -24,4 +41,13 @@ namespace Timeline.Models.Http [Required(AllowEmptyStrings = false)] public string NewPassword { get; set; } = default!; } + + public class UserControllerAutoMapperProfile : Profile + { + public UserControllerAutoMapperProfile() + { + CreateMap(MemberList.Source); + CreateMap(MemberList.Source); + } + } } -- cgit v1.2.3