using FrameworkDAL.CustomCode.Notification; using FrameworkDAL.DTO.Notification; using FrameworkDAL.DTO.Server; using GB5Shared.DaprCache; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using GB5Shared.EntityHandler; using GB5Shared.GenerateAutoNumber; using GB5Shared.ListQuery; using GB5Shared.QueryExecutor; using GB5Shared.Resource.Response; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace FrameworkBLL.Notification { public class NotificationBLL : INotificationBLL { private readonly INotificationDAL _NotificationDAL; private readonly AutoNumber _AutoNumber; private readonly IQueryExecutor _QueryExecutor; private readonly KeyInvalidate _KeyInvalidate; private readonly BaseEntityAppService _BaseEntityAppService; public NotificationBLL( INotificationDAL NotificationDAL, AutoNumber autoNumber, IQueryExecutor queryExecutor, KeyInvalidate keyInvalidate, BaseEntityAppService baseEntityAppService) { _NotificationDAL = NotificationDAL; _AutoNumber = autoNumber; _QueryExecutor = queryExecutor; _KeyInvalidate = keyInvalidate; _BaseEntityAppService = baseEntityAppService; } public async Task GetNotificationUser(int firstNumber, int maxResult, CriteriaDTO criteriaDTO, LoginDTO loginDTO) => await _NotificationDAL.GetNotificationUser(firstNumber, maxResult, criteriaDTO, loginDTO) .ConfigureAwait(false); public async Task UpdateNotificationTo(int notificationToId, LoginDTO loginDTO) { await _NotificationDAL.UpdateNotificationTo(notificationToId, loginDTO).ConfigureAwait(false); return SuccessResponse.UpdateSuccessMessage; } public async Task UpdateAllNotification(int userId, LoginDTO loginDTO) { await _NotificationDAL.UpdateAllNotification(userId, loginDTO).ConfigureAwait(false); return SuccessResponse.UpdateSuccessMessage; } public async Task DeleteAllNotification(int userId, LoginDTO loginDTO) { await _NotificationDAL.DeleteAllNotification(userId, loginDTO).ConfigureAwait(false); return SuccessResponse.DeleteSuccessMessage; } public async Task DeleteOneNotification(int notificationToId, LoginDTO loginDTO) { await _NotificationDAL.DeleteOneNotification(notificationToId, loginDTO).ConfigureAwait(false); return SuccessResponse.DeleteSuccessMessage; } public async Task SaveNotification( string message, int fromUserId, int dataId, List toUserIds, LoginDTO loginDTO, CancellationToken cancellationToken = default) => await _NotificationDAL.SaveNotification(message, fromUserId, dataId, toUserIds, loginDTO, cancellationToken) .ConfigureAwait(false); } }