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