From f992f7fe091cb63a46c6196e011a39477fd5d90a Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Fri, 28 Feb 2025 10:38:27 +0330 Subject: [PATCH] notification for pinterest suggestion --- .../Services/Implementation/ArtifactService.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/RMuseum/Services/Implementation/ArtifactService.cs b/RMuseum/Services/Implementation/ArtifactService.cs index 8518defb..dd8e3902 100644 --- a/RMuseum/Services/Implementation/ArtifactService.cs +++ b/RMuseum/Services/Implementation/ArtifactService.cs @@ -29,6 +29,7 @@ using DNTPersianUtils.Core; using FluentFTP; using RSecurityBackend.Models.Notification; using RMuseum.Models.Ganjoor; +using RMuseum.Models.Auth.Memory; namespace RMuseum.Services.Implementation { @@ -3298,6 +3299,21 @@ namespace RMuseum.Services.Implementation }; _context.PinterestLinks.Add(link); await _context.SaveChangesAsync(); + var moderators = await _userService.GetUsersHavingPermission(RMuseumSecurableItem.ArtifactEntityShortName, RMuseumSecurableItem.ReviewGanjoorLinksOperationShortName); + if (string.IsNullOrEmpty(moderators.ExceptionString)) //if not, do nothing! + { + foreach (var moderator in moderators.Result) + { + await _notificationService.PushNotification + ( + (Guid)moderator.Id, + "پیشنهاد تصویر خارجی مرتبط با شعر", + $"تصویری خارج از گنجور برای ارتباط با اشعار ثبت شده است. لطفاً بخش بازبینی تصاویر را بررسی فرمایید.{Environment.NewLine}" + + $"توجه فرمایید که اگر کاربر دیگری که دارای مجوز بررسی تصاویر است پیش از شما به آن رسیدگی کرده باشد آن را در صف نخواهید دید.", + NotificationType.ActionRequired + ); + } + } return new RServiceResult ( new PinterestLinkViewModel()