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

namespace HoneyBox.Admin.Entities;

/// <summary>
/// 管理员-菜单关联表（用户专属菜单）
/// </summary>
[Table("admin_user_menus")]
public class AdminUserMenu
{
    /// <summary>
    /// 主键ID
    /// </summary>
    [Key]
    public long Id { get; set; }

    /// <summary>
    /// 管理员ID
    /// </summary>
    public long AdminUserId { get; set; }

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

    // 导航属性
    /// <summary>
    /// 管理员
    /// </summary>
    [ForeignKey("AdminUserId")]
    public virtual AdminUser AdminUser { get; set; } = null!;

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