From ac769e656b122ff569c3f1534701b71e00fed586 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 27 Oct 2020 19:21:35 +0800 Subject: Split front and back end. --- Timeline/Models/Http/UserController.cs | 93 ---------------------------------- 1 file changed, 93 deletions(-) delete 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 deleted file mode 100644 index 6bc5a66e..00000000 --- a/Timeline/Models/Http/UserController.cs +++ /dev/null @@ -1,93 +0,0 @@ -using AutoMapper; -using System.ComponentModel.DataAnnotations; -using Timeline.Controllers; -using Timeline.Models.Validation; - -namespace Timeline.Models.Http -{ - /// - /// Request model for . - /// - public class UserPatchRequest - { - /// - /// New username. Null if not change. Need to be administrator. - /// - [Username] - public string? Username { get; set; } - - /// - /// New password. Null if not change. Need to be administrator. - /// - [MinLength(1)] - public string? Password { get; set; } - - /// - /// New nickname. Null if not change. Need to be administrator to change other's. - /// - [Nickname] - public string? Nickname { get; set; } - - /// - /// Whether to be administrator. Null if not change. Need to be administrator. - /// - public bool? Administrator { get; set; } - } - - /// - /// Request model for . - /// - public class CreateUserRequest - { - /// - /// Username of the new user. - /// - [Required, Username] - public string Username { get; set; } = default!; - - /// - /// Password of the new user. - /// - [Required, MinLength(1)] - public string Password { get; set; } = default!; - - /// - /// Whether the new user is administrator. - /// - [Required] - public bool? Administrator { get; set; } - - /// - /// Nickname of the new user. - /// - [Nickname] - public string? Nickname { get; set; } - } - - /// - /// Request model for . - /// - public class ChangePasswordRequest - { - /// - /// Old password. - /// - [Required(AllowEmptyStrings = false)] - public string OldPassword { get; set; } = default!; - - /// - /// New password. - /// - [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