Add Webinar ID Support for Viewer Join and Leave ...
This commit is contained in:
+17
-11
@@ -12,7 +12,7 @@ using xPushService.Base;
|
|||||||
using xPushService.Extensions;
|
using xPushService.Extensions;
|
||||||
using xWebinarService.Constants;
|
using xWebinarService.Constants;
|
||||||
using xWebinarService.Models.Dtos;
|
using xWebinarService.Models.Dtos;
|
||||||
using xWebinarService.Providers;
|
using xWebinarService.Interfaces;
|
||||||
|
|
||||||
namespace xWebinarService.Hub
|
namespace xWebinarService.Hub
|
||||||
{
|
{
|
||||||
@@ -20,14 +20,14 @@ namespace xWebinarService.Hub
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
#region Props ...
|
#region Props ...
|
||||||
public readonly XWebinarProvider webinarProvider;
|
public readonly IXWebinarProvider webinarProvider;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
#region Constructor ...
|
#region Constructor ...
|
||||||
public XWebinarHub(
|
public XWebinarHub(
|
||||||
ILogger<XWebinarHub> logger,
|
ILogger<XWebinarHub> logger,
|
||||||
XWebinarProvider webinarProvider
|
IXWebinarProvider webinarProvider
|
||||||
) : base(logger)
|
) : base(logger)
|
||||||
{
|
{
|
||||||
this.webinarProvider = webinarProvider;
|
this.webinarProvider = webinarProvider;
|
||||||
@@ -260,7 +260,12 @@ namespace xWebinarService.Hub
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Notify Other Users which a Viewer Joined ...
|
// Notify Other Users which a Viewer Joined ...
|
||||||
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerJoined.GetStringValue(), connectionId, userInfo.UserId, userInfo.UserName);
|
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerJoined.GetStringValue(),
|
||||||
|
connectionId,
|
||||||
|
webinarId,
|
||||||
|
userInfo.UserId,
|
||||||
|
userInfo.UserName
|
||||||
|
);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{ }
|
{ }
|
||||||
@@ -339,9 +344,10 @@ namespace xWebinarService.Hub
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Notify Other Users which a Viewer Leaved ...
|
// Notify Other Users which a Viewer Leaved ...
|
||||||
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerLeaved.GetStringValue(),
|
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerLeaved.GetStringValue(),
|
||||||
connectionId,
|
connectionId,
|
||||||
userInfo.UserId,
|
webinarId,
|
||||||
|
userInfo.UserId,
|
||||||
userInfo.UserName
|
userInfo.UserName
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -420,10 +426,10 @@ namespace xWebinarService.Hub
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Notify Other Users which a Viewer Leaved ...
|
// Notify Other Users which a Viewer Leaved ...
|
||||||
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.Message.GetStringValue(),
|
await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.Message.GetStringValue(),
|
||||||
connectionId,
|
connectionId,
|
||||||
userInfo.UserId,
|
userInfo.UserId,
|
||||||
userInfo.UserName,
|
userInfo.UserName,
|
||||||
message
|
message
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ namespace xWebinarService.Providers
|
|||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
Type = model.Type,
|
Type = model.Type,
|
||||||
OwnerId = model.OwnerId,
|
OwnerId = model.OwnerId,
|
||||||
|
Enabled = model.Enabled,
|
||||||
CreatedOn = model.CreatedOn,
|
CreatedOn = model.CreatedOn,
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -334,6 +335,15 @@ namespace xWebinarService.Providers
|
|||||||
entity.Type = item.Type;
|
entity.Type = item.Type;
|
||||||
entity = await WebinarRepository.UpdateAsync(entity.Id, entity);
|
entity = await WebinarRepository.UpdateAsync(entity.Id, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check if Enabled Change Update it ...
|
||||||
|
if (entity.Enabled != item.Enabled)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
entity.Enabled = item.Enabled;
|
||||||
|
entity = await WebinarRepository.UpdateAsync(entity.Id, entity);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Retrieve Entity Dto ...
|
// Retrieve Entity Dto ...
|
||||||
|
|||||||
Reference in New Issue
Block a user