namespace QYZH.InteractiveMagazine.Models.Dto;

/// <summary>
/// 后台菜单输入
/// </summary>
public class AdminMenuInput
{
    /// <summary>
    /// 父级菜单ID，根节点为0
    /// </summary>
    public long ParentId { get; set; }

    /// <summary>
    /// 菜单名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 权限编码
    /// </summary>
    public string Code { get; set; } = string.Empty;

    /// <summary>
    /// 前端路由路径
    /// </summary>
    public string? Path { get; set; }

    /// <summary>
    /// 前端组件路径
    /// </summary>
    public string? Component { get; set; }

    /// <summary>
    /// 菜单图标
    /// </summary>
    public string? Icon { get; set; }

    /// <summary>
    /// 排序值
    /// </summary>
    public int Sort { get; set; }

    /// <summary>
    /// 是否显示在菜单
    /// </summary>
    public bool IsVisible { get; set; } = true;

    /// <summary>
    /// 状态
    /// </summary>
    public int Status { get; set; } = 1;
}

/// <summary>
/// 后台菜单输出
/// </summary>
public class AdminMenuOutput
{
    /// <summary>
    /// 菜单ID
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 父级菜单ID
    /// </summary>
    public long ParentId { get; set; }

    /// <summary>
    /// 菜单名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 权限编码
    /// </summary>
    public string Code { get; set; } = string.Empty;

    /// <summary>
    /// 前端路由路径
    /// </summary>
    public string? Path { get; set; }

    /// <summary>
    /// 前端组件路径
    /// </summary>
    public string? Component { get; set; }

    /// <summary>
    /// 菜单图标
    /// </summary>
    public string? Icon { get; set; }

    /// <summary>
    /// 排序值
    /// </summary>
    public int Sort { get; set; }

    /// <summary>
    /// 是否显示在菜单
    /// </summary>
    public bool IsVisible { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public int Status { get; set; }

    /// <summary>
    /// 子菜单
    /// </summary>
    public List<AdminMenuOutput> Children { get; set; } = [];
}

/// <summary>
/// 后台菜单查询输入
/// </summary>
public class AdminMenuQueryInput
{
    /// <summary>
    /// 菜单名称
    /// </summary>
    public string? Name { get; set; }

    /// <summary>
    /// 权限编码
    /// </summary>
    public string? Code { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public int? Status { get; set; }
}

/// <summary>
/// 后台角色输入
/// </summary>
public class AdminRoleInput
{
    /// <summary>
    /// 角色名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 角色编码
    /// </summary>
    public string Code { get; set; } = string.Empty;

    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public int Status { get; set; } = 1;

    /// <summary>
    /// 菜单ID集合
    /// </summary>
    public List<long> MenuIds { get; set; } = [];
}

/// <summary>
/// 后台角色输出
/// </summary>
public class AdminRoleOutput
{
    /// <summary>
    /// 角色ID
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 角色名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 角色编码
    /// </summary>
    public string Code { get; set; } = string.Empty;

    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public int Status { get; set; }

    /// <summary>
    /// 菜单ID集合
    /// </summary>
    public List<long> MenuIds { get; set; } = [];

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreatedAt { get; set; }
}

/// <summary>
/// 后台角色简要输出
/// </summary>
public class AdminRoleSimpleOutput
{
    /// <summary>
    /// 角色ID
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 角色名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 角色编码
    /// </summary>
    public string Code { get; set; } = string.Empty;
}

/// <summary>
/// 后台角色查询输入
/// </summary>
public class AdminRoleQueryInput : PageQueryModel
{
    /// <summary>
    /// 角色名称
    /// </summary>
    public string? Name { get; set; }

    /// <summary>
    /// 角色编码
    /// </summary>
    public string? Code { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public int? Status { get; set; }
}

/// <summary>
/// 分配角色菜单输入
/// </summary>
public class AssignRoleMenusInput
{
    /// <summary>
    /// 菜单ID集合
    /// </summary>
    public List<long> MenuIds { get; set; } = [];
}

/// <summary>
/// 分配用户角色输入
/// </summary>
public class AssignAdminUserRolesInput
{
    /// <summary>
    /// 角色ID集合
    /// </summary>
    public List<long> RoleIds { get; set; } = [];
}
