- 将 file 相关端点命名空间从小写改为首字母大写 - 将 im 相关端点命名空间从小写改为首字母大写 - 将 workflow 相关端点命名空间从小写改为首字母大写 - 将 rag 相关端点命名空间从小写改为首字母大写 - 将 platform 相关端点命名空间从小写改为首字母大写 - 保持代码功能不变,仅调整命名空间命名风格一致性
43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using BuildFlow.Platform.Application.Menus.Commands;
|
|
using BuildFlow.Platform.Application.Menus.DTOs;
|
|
using MediatR;
|
|
|
|
namespace BuildFlow.Host.Endpoints.Platform.Menus;
|
|
|
|
/// <summary>
|
|
/// 创建菜单端点。
|
|
/// </summary>
|
|
public class CreateMenuEndpoint(IMediator mediator) : Endpoint<CreateMenuRequest, MenuDto>
|
|
{
|
|
public override void Configure()
|
|
{
|
|
Post("/menus");
|
|
Permissions("menu:create");
|
|
}
|
|
|
|
public override async Task HandleAsync(CreateMenuRequest req, CancellationToken ct)
|
|
{
|
|
var result = await mediator.Send(new CreateMenuCommand
|
|
{
|
|
ParentId = req.ParentId,
|
|
Name = req.Name,
|
|
Path = req.Path,
|
|
Component = req.Component,
|
|
Redirect = req.Redirect,
|
|
Title = req.Title,
|
|
Code = req.Code,
|
|
Icon = req.Icon,
|
|
ActiveIcon = req.ActiveIcon,
|
|
Order = req.Order,
|
|
HideInMenu = req.HideInMenu,
|
|
KeepAlive = req.KeepAlive,
|
|
AffixTab = req.AffixTab,
|
|
Link = req.Link,
|
|
NoBasicLayout = req.NoBasicLayout,
|
|
MenuVisibleWithForbidden = req.MenuVisibleWithForbidden,
|
|
Authority = req.Authority,
|
|
}, ct);
|
|
await Send.ResponseAsync(result, 201, ct);
|
|
}
|
|
}
|