using Common.Enum; using Entity.DbModel.System.SysBaseObject; using Mapster; namespace Entity.Dto.Resp { /// /// 系统菜单返回结果 /// public class MenuResp { /// /// 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 int OrderNo { get; set; } /// /// 状态 /// public StatusEnum Status { get; set; } /// /// 备注 /// public string Remark { get; set; } /// /// 创建时间 /// public virtual DateTime CreateTime { get; set; } /// /// 更新时间 /// public virtual DateTime UpdateTime { get; set; } /// /// 创建者姓名 /// public virtual string CreateUserName { get; set; } /// /// 修改者姓名 /// public virtual string UpdateUserName { 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 bool IsIframe { get; set; } /// /// 外链链接 /// public string IsLink { get; set; } /// /// 是否隐藏 /// public bool IsHide { get; set; } /// /// 是否缓存 /// public bool IsKeepAlive { get; set; } /// /// 是否固定 /// public bool IsAffix { get; set; } } /// /// 配置菜单对象映射 /// public class SysMenuMapper : IRegister { public void Register(TypeAdapterConfig config) { config.NewConfig() .Map(t => t.Meta.Title, o => o.Title) .Map(t => t.Meta.Icon, o => o.Icon) .Map(t => t.Meta.IsIframe, o => o.IsIframe) .Map(t => t.Meta.IsLink, o => o.OutLink) .Map(t => t.Meta.IsHide, o => o.IsHide) .Map(t => t.Meta.IsKeepAlive, o => o.IsKeepAlive) .Map(t => t.Meta.IsAffix, o => o.IsAffix) .Compile(); } } }