#17 (no 1 and a part of no 2 in issue is done)
This commit is contained in:
parent
661b26f043
commit
77ea4be8a5
@ -4504,13 +4504,19 @@
|
|||||||
Background Task Queue Instance
|
Background Task Queue Instance
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:RMuseum.Services.Implementation.AudioNarrationService.#ctor(RMuseum.DbContext.RMuseumDbContext,Microsoft.Extensions.Configuration.IConfiguration,RMuseum.Services.IBackgroundTaskQueue)">
|
<member name="F:RMuseum.Services.Implementation.AudioNarrationService._notificationService">
|
||||||
|
<summary>
|
||||||
|
Messaging service
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:RMuseum.Services.Implementation.AudioNarrationService.#ctor(RMuseum.DbContext.RMuseumDbContext,Microsoft.Extensions.Configuration.IConfiguration,RMuseum.Services.IBackgroundTaskQueue,RMuseum.Services.IRNotificationService)">
|
||||||
<summary>
|
<summary>
|
||||||
constructor
|
constructor
|
||||||
</summary>
|
</summary>
|
||||||
<param name="context"></param>
|
<param name="context"></param>
|
||||||
<param name="configuration"></param>
|
<param name="configuration"></param>
|
||||||
<param name="backgroundTaskQueue"></param>
|
<param name="backgroundTaskQueue"></param>
|
||||||
|
<param name="notificationService"></param>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:RMuseum.Services.Implementation.BLTileMixer">
|
<member name="T:RMuseum.Services.Implementation.BLTileMixer">
|
||||||
<summary>
|
<summary>
|
||||||
|
|||||||
@ -484,6 +484,14 @@ namespace RMuseum.Services.Implementation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
await context.SaveChangesAsync();
|
await context.SaveChangesAsync();
|
||||||
|
|
||||||
|
await _notificationService.PushNotification
|
||||||
|
(
|
||||||
|
session.UseId,
|
||||||
|
"پایان پردازش خوانش بارگذاری شده",
|
||||||
|
$"پردازش خوانشهای بارگذاری شدهٔ اخیر شما تکمیل شده است.{Environment.NewLine}" +
|
||||||
|
$"میتوانید با مراجعه به این صفحه TODO: client url وضعیت آنها را بررسی و ذر صورت عدم وجود خطا تقاضای بررسی آنها توسط ناظران را ثبت کنید."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -519,14 +527,31 @@ namespace RMuseum.Services.Implementation
|
|||||||
narration.ReviewDate = DateTime.Now;
|
narration.ReviewDate = DateTime.Now;
|
||||||
narration.ReviewerId = moderatorId;
|
narration.ReviewerId = moderatorId;
|
||||||
narration.ReviewStatus = model.Approve ? AudioReviewStatus.Approved : AudioReviewStatus.Rejected;
|
narration.ReviewStatus = model.Approve ? AudioReviewStatus.Approved : AudioReviewStatus.Rejected;
|
||||||
|
if(!model.Approve)
|
||||||
|
{
|
||||||
|
narration.AudioSyncStatus = (int)AudioSyncStatus.SynchronizedOrRejected;
|
||||||
|
//TODO: send narration in a delayed deletion queue or delete rejected items passed a certain period of time in a maintenance job
|
||||||
|
}
|
||||||
narration.ReviewMsg = model.Message;
|
narration.ReviewMsg = model.Message;
|
||||||
_context.AudioFiles.Update(narration);
|
_context.AudioFiles.Update(narration);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
//TODO: 1 . notify user on moderation result
|
//TODO: 1 . notify user on moderation result
|
||||||
|
if(narration.ReviewStatus == AudioReviewStatus.Rejected)
|
||||||
|
{
|
||||||
|
await _notificationService.PushNotification
|
||||||
|
(
|
||||||
|
narration.OwnerId,
|
||||||
|
"عدم پذیرش خوانش ارسالی",
|
||||||
|
$"خوانش ارسالی شما قابل پذیرش نبود.{Environment.NewLine}" +
|
||||||
|
$"میتوانید با مراجعه به این صفحه TODO: client url وضعیت آن را بررسی کنید.."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: 2 . start a background job for finalizing approved narrations
|
//TODO: 2 . start a background job for finalizing approved narrations
|
||||||
//TODO: 3 . notify user on publication of approved narration
|
//TODO: 3 . notify user on publication of approved narration
|
||||||
|
|
||||||
|
|
||||||
return new RServiceResult<bool>(true);
|
return new RServiceResult<bool>(true);
|
||||||
}
|
}
|
||||||
catch (Exception exp)
|
catch (Exception exp)
|
||||||
@ -739,17 +764,25 @@ namespace RMuseum.Services.Implementation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected readonly IBackgroundTaskQueue _backgroundTaskQueue;
|
protected readonly IBackgroundTaskQueue _backgroundTaskQueue;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Messaging service
|
||||||
|
/// </summary>
|
||||||
|
protected readonly IRNotificationService _notificationService;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// constructor
|
/// constructor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context"></param>
|
/// <param name="context"></param>
|
||||||
/// <param name="configuration"></param>
|
/// <param name="configuration"></param>
|
||||||
/// <param name="backgroundTaskQueue"></param>
|
/// <param name="backgroundTaskQueue"></param>
|
||||||
public AudioNarrationService(RMuseumDbContext context, IConfiguration configuration, IBackgroundTaskQueue backgroundTaskQueue)
|
/// <param name="notificationService"></param>
|
||||||
|
public AudioNarrationService(RMuseumDbContext context, IConfiguration configuration, IBackgroundTaskQueue backgroundTaskQueue, IRNotificationService notificationService)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
Configuration = configuration;
|
Configuration = configuration;
|
||||||
_backgroundTaskQueue = backgroundTaskQueue;
|
_backgroundTaskQueue = backgroundTaskQueue;
|
||||||
|
_notificationService = notificationService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user