feat(console): add user DTOs

This commit is contained in:
Sam 2026-02-05 14:13:17 +08:00
parent b8a76dfd93
commit 50c443fdfa
4 changed files with 75 additions and 0 deletions

View 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;
}

View 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;
}

View 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
View 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; }
}