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

namespace HoneyBox.Admin.Entities;

/// <summary>
/// 部门-菜单关联表
/// </summary>
[Table("department_menus")]
public class DepartmentMenu
{
    /// <summary>
    /// 主键ID
    /// </summary>
    [Key]
    public long Id { get; set; }

    /// <summary>
    /// 部门ID
    /// </summary>
    public long DepartmentId { get; set; }

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

    // 导航属性
    /// <summary>
    /// 部门
    /// </summary>
    [ForeignKey("DepartmentId")]
    public virtual Department Department { get; set; } = null!;

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