feat(console): add user DTOs
This commit is contained in:
parent
b8a76dfd93
commit
50c443fdfa
30
Models/Dtos/CreateUserDto.cs
Normal file
30
Models/Dtos/CreateUserDto.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Fengling.Console.Models.Dtos;
|
||||
|
||||
public class CreateUserDto
|
||||
{
|
||||
[Required]
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string RealName { get; set; } = string.Empty;
|
||||
|
||||
public string? Phone { get; set; }
|
||||
|
||||
public long? TenantId { get; set; }
|
||||
|
||||
public List<long> RoleIds { get; set; } = new();
|
||||
|
||||
[Required]
|
||||
[MinLength(6)]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
public bool EmailConfirmed { get; set; }
|
||||
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
10
Models/Dtos/ResetPasswordDto.cs
Normal file
10
Models/Dtos/ResetPasswordDto.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Fengling.Console.Models.Dtos;
|
||||
|
||||
public class ResetPasswordDto
|
||||
{
|
||||
[Required]
|
||||
[MinLength(6)]
|
||||
public string NewPassword { get; set; } = string.Empty;
|
||||
}
|
||||
19
Models/Dtos/UpdateUserDto.cs
Normal file
19
Models/Dtos/UpdateUserDto.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Fengling.Console.Models.Dtos;
|
||||
|
||||
public class UpdateUserDto
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string RealName { get; set; } = string.Empty;
|
||||
|
||||
public string? Phone { get; set; }
|
||||
|
||||
public bool EmailConfirmed { get; set; }
|
||||
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
16
Models/Dtos/UserDto.cs
Normal file
16
Models/Dtos/UserDto.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace Fengling.Console.Models.Dtos;
|
||||
|
||||
public class UserDto
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string? UserName { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? RealName { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public long TenantId { get; set; }
|
||||
public string TenantName { get; set; } = "";
|
||||
public List<string> Roles { get; set; } = new();
|
||||
public bool EmailConfirmed { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user