build-flow.api/src/build-flow.host/Endpoints/im/Chat/RecallMessageEndpoint.cs
xiangning 6f8ff793c5 refactor: 目录名统一小写(BuildFlow.Host→build-flow.host,BuildFlow.Shared→build-flow.shared)
- src/BuildFlow.Host → src/build-flow.host
- src/shared/BuildFlow.Shared → src/shared/build-flow.shared
- 同步改 slnx/ProjectReference/run-dev.sh 路径
- csproj 文件名 + AssemblyName/RootNamespace 保持 PascalCase(.NET 规范)
- build 0/0
2026-07-02 17:41:57 +08:00

22 lines
857 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using BuildFlow.Shared.Domain.Common;
using IM.Application.Chat.Commands;
using MediatR;
namespace BuildFlow.Host.Endpoints.im.Chat;
/// <summary>
/// 撤回消息 REST 端点(SignalR 的非实时兜底通道)。
/// 权限与时间窗校验在 RecallMessageCommandHandler 内统一执行。
/// </summary>
public class RecallMessageEndpoint(IMediator mediator, ICurrentUserContext userContext) : Endpoint<RecallMessageEndpointRequest>
{
public override void Configure() => Post("/conversations/{ConversationId}/messages/{MessageId}/recall");
public override async Task HandleAsync(RecallMessageEndpointRequest req, CancellationToken ct)
{
var userId = userContext.GetRequiredUserGuid();
await mediator.Send(new RecallMessageCommand(req.ConversationId, req.MessageId, userId), ct);
await Send.OkAsync(ct);
}
}