using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HoneyBox.Admin.Entities;
///
/// 角色
///
[Table("roles")]
public class Role
{
///
/// 主键ID
///
[Key]
public long Id { get; set; }
///
/// 角色名称
///
[Required]
[MaxLength(50)]
public string Name { get; set; } = null!;
///
/// 角色编码
///
[Required]
[MaxLength(50)]
public string Code { get; set; } = null!;
///
/// 角色描述
///
[MaxLength(500)]
public string? Description { get; set; }
///
/// 排序号
///
public int SortOrder { get; set; } = 0;
///
/// 状态:0禁用 1启用
///
public byte Status { get; set; } = 1;
///
/// 是否系统角色(系统角色不可删除)
///
public bool IsSystem { get; set; } = false;
///
/// 创建时间
///
public DateTime CreatedAt { get; set; } = DateTime.Now;
///
/// 更新时间
///
public DateTime? UpdatedAt { get; set; }
// 导航属性
///
/// 用户角色关联
///
public virtual ICollection AdminUserRoles { get; set; } = new List();
///
/// 角色菜单关联
///
public virtual ICollection RoleMenus { get; set; } = new List();
///
/// 角色权限关联
///
public virtual ICollection RolePermissions { get; set; } = new List();
}