first commit

This commit is contained in:
yanpeng200212
2026-10-08 10:43:59 +08:00
commit 8430ba0452
288 changed files with 29595 additions and 0 deletions
@@ -0,0 +1,22 @@
using F9WebAiTest.Application.Common.Exceptions;
using F9WebAiTest.Domain.Interfaces.SYS.RBAC.Menus;
using MediatR;
namespace F9WebAiTest.Application.CQRS.SYS.RBAC.Menus.Commands;
/// <summary>命令定义</summary>
public record Menu_DelCommand(long Id) : IRequest<bool>;
/// <summary>命令处理器</summary>
public class DelMenuCommandHandler(
IMenuWriteRepository menuWriteRepository) : IRequestHandler<Menu_DelCommand, bool>
{
public async Task<bool> Handle(Menu_DelCommand command, CancellationToken cancellationToken)
{
if (command.Id <= 0) throw new F9OperationException("菜单ID不能为空");
var result = await menuWriteRepository.SoftDeleteAsync(command.Id);
if (result == false) throw new F9OperationException("菜单", "删除");
return result;
}
}