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

namespace HoneyBox.Admin.Entities;

/// <summary>
/// 管理员-角色关联表
/// </summary>
[Table("admin_user_roles")]
public class AdminUserRole
{
    /// <summary>
    /// 主键ID
    /// </summary>
    [Key]
    public long Id { get; set; }

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

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

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

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