feat: add admin menu management crud

This commit is contained in:
2025-12-05 21:16:07 +08:00
parent 02e33de5c8
commit a1499fc1a1
22 changed files with 1747 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
using MediatR;
using System.Collections.Generic;
using TakeoutSaaS.Application.Identity.Contracts;
namespace TakeoutSaaS.Application.Identity.Commands;
/// <summary>
/// 创建菜单命令。
/// </summary>
public sealed record CreateMenuCommand : IRequest<MenuDefinitionDto>
{
public long ParentId { get; init; }
public string Name { get; init; } = string.Empty;
public string Path { get; init; } = string.Empty;
public string Component { get; init; } = string.Empty;
public string Title { get; init; } = string.Empty;
public string? Icon { get; init; }
public bool IsIframe { get; init; }
public string? Link { get; init; }
public bool KeepAlive { get; init; }
public int SortOrder { get; init; }
public IReadOnlyCollection<string> RequiredPermissions { get; init; } = [];
public IReadOnlyCollection<string> MetaPermissions { get; init; } = [];
public IReadOnlyCollection<string> MetaRoles { get; init; } = [];
public IReadOnlyCollection<MenuAuthItemDto> AuthList { get; init; } = [];
}

View File

@@ -0,0 +1,11 @@
using MediatR;
namespace TakeoutSaaS.Application.Identity.Commands;
/// <summary>
/// 删除菜单命令。
/// </summary>
public sealed record DeleteMenuCommand : IRequest<bool>
{
public long Id { get; init; }
}

View File

@@ -0,0 +1,27 @@
using MediatR;
using System.Collections.Generic;
using TakeoutSaaS.Application.Identity.Contracts;
namespace TakeoutSaaS.Application.Identity.Commands;
/// <summary>
/// 更新菜单命令。
/// </summary>
public sealed record UpdateMenuCommand : IRequest<MenuDefinitionDto?>
{
public long Id { get; init; }
public long ParentId { get; init; }
public string Name { get; init; } = string.Empty;
public string Path { get; init; } = string.Empty;
public string Component { get; init; } = string.Empty;
public string Title { get; init; } = string.Empty;
public string? Icon { get; init; }
public bool IsIframe { get; init; }
public string? Link { get; init; }
public bool KeepAlive { get; init; }
public int SortOrder { get; init; }
public IReadOnlyCollection<string> RequiredPermissions { get; init; } = [];
public IReadOnlyCollection<string> MetaPermissions { get; init; } = [];
public IReadOnlyCollection<string> MetaRoles { get; init; } = [];
public IReadOnlyCollection<MenuAuthItemDto> AuthList { get; init; } = [];
}