53 lines
1.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.ComponentModel.DataAnnotations;
namespace AmtScanner.Api.Models;
/// <summary>
/// 系统角色
/// </summary>
public class Role
{
[Key]
public int Id { get; set; }
/// <summary>
/// 角色名称
/// </summary>
[Required]
[MaxLength(100)]
public string RoleName { get; set; } = string.Empty;
/// <summary>
/// 角色编码(如 R_SUPER, R_ADMIN, R_USER
/// </summary>
[Required]
[MaxLength(50)]
public string RoleCode { get; set; } = string.Empty;
/// <summary>
/// 角色描述
/// </summary>
[MaxLength(500)]
public string? Description { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public bool Enabled { get; set; } = true;
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
/// <summary>
/// 用户角色关联
/// </summary>
public ICollection<UserRole> UserRoles { get; set; } = new List<UserRole>();
/// <summary>
/// 角色菜单关联
/// </summary>
public ICollection<RoleMenu> RoleMenus { get; set; } = new List<RoleMenu>();
}