| 1234567891011121314151617181920212223242526272829303132 |
- using Web.Api.Common;
- using Web.Api.Extensions;
- using MediatR;
- using System.Security.Claims;
- namespace Web.Api.Endpoints.Forum.Comment;
- internal sealed class Mention : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/forum/comments/mention", async (
- ClaimsPrincipal user,
- ISender sender,
- CancellationToken ct,
- int postID,
- string? keyword = null
- ) =>
- {
- var memberID = user.GetMemberID();
- return ApiResponse.Ok(
- await sender.Send(
- new Application.Features.Api.Forum.Comment.Mention.Query(postID, keyword, memberID),
- ct
- )
- );
- })
- .WithTags("Forum")
- .AllowAnonymous();
- }
- }
|