using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace HoneyBox.Admin.Entities;

/// <summary>
/// 角色-菜单关联表
/// </summary>
[Table("role_menus")]
public class RoleMenu
{
    /// <summary>
    /// 主键ID
    /// </summary>
    [Key]
    public long Id { get; set; }

    /// <summary>
    /// 角色ID
    /// </summary>
    public long RoleId { get; set; }

    /// <summary>
    /// 菜单ID
    /// </summary>
    public long MenuId { get; set; }

    // 导航属性
    /// <summary>
    /// 角色
    /// </summary>
    [ForeignKey("RoleId")]
    public virtual Role Role { get; set; } = null!;

    /// <summary>
    /// 菜单
    /// </summary>
    [ForeignKey("MenuId")]
    public virtual Menu Menu { get; set; } = null!;
}
