using System.Collections.Generic; using System.Text.Json.Serialization; namespace TakeoutSaaS.Application.Identity.Contracts; /// /// 菜单前端元数据。 /// public sealed record MenuMetaDto { /// /// 菜单标题(i18n key)。 /// [JsonPropertyName("title")] public required string Title { get; init; } /// /// 图标标识。 /// [JsonPropertyName("icon")] public string? Icon { get; init; } /// /// 是否缓存页面。 /// [JsonPropertyName("keepAlive")] public bool KeepAlive { get; init; } /// /// 是否为 iframe 页面。 /// [JsonPropertyName("isIframe")] public bool IsIframe { get; init; } /// /// 外链或 iframe 地址。 /// [JsonPropertyName("link")] public string? Link { get; init; } /// /// 允许访问的角色编码集合。 /// [JsonPropertyName("roles")] public string[] Roles { get; init; } = System.Array.Empty(); /// /// 按钮/操作级别权限。 /// [JsonPropertyName("authList")] public IReadOnlyList AuthList { get; init; } = System.Array.Empty(); /// /// 访问该菜单所需的权限编码集合(前端用于路由级鉴权)。 /// [JsonPropertyName("permissions")] public string[] Permissions { get; init; } = System.Array.Empty(); }