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 UpdateAllNotification : BaseEndpoint> { private readonly INotificationBLL _bll; public UpdateAllNotification(INotificationBLL bll) => _bll = bll; public override void Configure() { Get("/Notification/UpdateAllNotification"); AllowAnonymous(); } public record Parameters( [property: FromHeader] string Login, [property: QueryParam] int UserId); protected override async Task> ExecuteAsync( Parameters req, LoginDTO loginDTO, CancellationToken ct) { var result = await _bll.UpdateAllNotification(req.UserId, loginDTO); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse( result, CacheKeyLevel.NOT_REQUIRED, loginDTO); } }