feat(console): add role DTOs

This commit is contained in:
Sam 2026-02-05 14:14:19 +08:00
parent 8a20a3368e
commit abb5cd7c41
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations;
namespace Fengling.Console.Models.Dtos;
public class CreateRoleDto
{
[Required]
public string Name { get; set; } = string.Empty;
[Required]
public string DisplayName { get; set; } = string.Empty;
public string? Description { get; set; }
public long? TenantId { get; set; }
public List<string> Permissions { get; set; } = new();
}

14
Models/Dtos/RoleDto.cs Normal file
View File

@ -0,0 +1,14 @@
namespace Fengling.Console.Models.Dtos;
public class RoleDto
{
public long Id { get; set; }
public string? Name { get; set; }
public string? DisplayName { get; set; }
public string? Description { get; set; }
public long? TenantId { get; set; }
public bool IsSystem { get; set; }
public List<string>? Permissions { get; set; }
public int UserCount { get; set; }
public DateTime CreatedAt { get; set; }
}

View File

@ -0,0 +1,13 @@
using System.ComponentModel.DataAnnotations;
namespace Fengling.Console.Models.Dtos;
public class UpdateRoleDto
{
[Required]
public string DisplayName { get; set; } = string.Empty;
public string? Description { get; set; }
public List<string> Permissions { get; set; } = new();
}