using FastEndpoints; using FrameworkBLL.Notification; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static FrameworkDAL.Constant.Constant; namespace FrameworkSL.Endpoints.Notification; public class UpdateNotificationTo : BaseEndpoint> { private readonly INotificationBLL _bll; public UpdateNotificationTo(INotificationBLL bll) => _bll = bll; public override void Configure() { Get("Notification/NotificationTo"); AllowAnonymous(); } public record Parameters( [property: FromHeader] string Login, [property: QueryParam] int NotificationToId); protected override async Task> ExecuteAsync( Parameters req, LoginDTO loginDTO, CancellationToken ct) { var result = await _bll.UpdateNotificationTo(req.NotificationToId, loginDTO); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse( result, CacheKeyLevel.NOT_REQUIRED, loginDTO); } }