namespace Admin.NET.Core.Service; /// /// 系统菜单返回结果 /// public class MenuOutput { /// /// Id /// public long Id { get; set; } /// /// 父Id /// public long Pid { get; set; } /// /// 菜单类型(0目录 1菜单 2按钮) /// public MenuTypeEnum Type { get; set; } /// /// 名称 /// public string Name { get; set; } /// /// 路由地址 /// public string Path { get; set; } /// /// 组件路径 /// public string Component { get; set; } /// /// 权限标识 /// public string Permission { get; set; } /// /// 重定向 /// public string Redirect { get; set; } /// /// 是否可用 /// public bool Disabled { get; set; } /// /// 菜单Meta /// public SysMenuMeta Meta { get; set; } /// /// 菜单子项 /// public List Children { get; set; } } /// /// 菜单Meta配置 /// public class SysMenuMeta { /// /// 标题 /// public string Title { get; set; } /// /// 图标 /// public string Icon { get; set; } /// /// 内嵌地址 /// public string FrameSrc { get; set; } /// /// 排序 /// public int OrderNo { get; set; } /// /// 是否显示 /// public bool HideMenu { get; set; } /// /// 是否忽略KeepAlive缓存 /// public bool IgnoreKeepAlive { get; set; } /// /// 当前激活的菜单-用于配置详情页时左侧激活的菜单路径 /// public string CurrentActiveMenu { get; set; } } /// /// 配置菜单对象映射 /// public class SysMenuMapper : IRegister { public void Register(TypeAdapterConfig config) { config.ForType() .Map(t => t.Meta.Title, o => o.Title) .Map(t => t.Meta.Icon, o => o.Icon) .Map(t => t.Meta.FrameSrc, o => o.FrameSrc) .Map(t => t.Meta.OrderNo, o => o.OrderNo) .Map(t => t.Meta.HideMenu, o => o.HideMenu) .Map(t => t.Meta.IgnoreKeepAlive, o => o.IgnoreKeepAlive) .Map(t => t.Meta.CurrentActiveMenu, o => o.CurrentActiveMenu); } }