|
@@ -138,7 +138,7 @@ public class RealtimeService : IRealtimeService, IScopeDependency
|
|
|
if (record.CircularType == Share.Enums.Article.ECircularType.Person)
|
|
|
{
|
|
|
//个人
|
|
|
- await SendMsgToUserAsync(record.UserId, RealtimeMethods.CircularRecord,
|
|
|
+ await SendToUserAsync(record.UserId, RealtimeMethods.CircularRecord,
|
|
|
new CircularRecoordDto() { CircularType = Share.Enums.Article.ECircularType.Person, Count = record.RecordCount },
|
|
|
cancellationToken);
|
|
|
}
|
|
@@ -150,7 +150,7 @@ public class RealtimeService : IRealtimeService, IScopeDependency
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- await SendMsgToUserAsync(user.Id, RealtimeMethods.CircularRecord,
|
|
|
+ await SendToUserAsync(user.Id, RealtimeMethods.CircularRecord,
|
|
|
new CircularRecoordDto()
|
|
|
{ CircularType = Share.Enums.Article.ECircularType.Org, Count = record.RecordCount },
|
|
|
cancellationToken);
|
|
@@ -164,12 +164,10 @@ public class RealtimeService : IRealtimeService, IScopeDependency
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region 通用
|
|
|
+ #region 大屏.数据展示
|
|
|
|
|
|
- //public int GetGroupMemberCount(string groupName)
|
|
|
- //{
|
|
|
- // _hubContext.Clients.Group(groupName)
|
|
|
- //}
|
|
|
+ public Task BsDataShowChangedAsync(object obj, CancellationToken cancellationToken) =>
|
|
|
+ SendToGroupAsync(RealtimeGroupNames.BigScreenDataShow, RealtimeMethods.BsDataShow, obj, cancellationToken);
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -195,14 +193,14 @@ public class RealtimeService : IRealtimeService, IScopeDependency
|
|
|
throw UserFriendlyException.SameMessage($"该用户不属于分组:{groupName}");
|
|
|
}
|
|
|
|
|
|
- private async Task SendMsgToUserAsync(string userId, string msg, object? value, CancellationToken cancellationToken)
|
|
|
+ private async Task SendToUserAsync(string userId, string msg, object? value, CancellationToken cancellationToken)
|
|
|
{
|
|
|
var connection = await _realtimeCacheManager.GetConnectionAsync(userId, cancellationToken);
|
|
|
await _hubContext.Clients.Client(connection.ConnectionId).SendAsync(msg, value, cancellationToken);
|
|
|
}
|
|
|
|
|
|
- private Task SendMsgToGroupAsync(string groupName, string msg, object? value, CancellationToken cancellationToken) =>
|
|
|
- _hubContext.Clients.Group(groupName).SendAsync(msg, value, cancellationToken);
|
|
|
+ private Task SendToGroupAsync(string groupName, string method, object? value, CancellationToken cancellationToken) =>
|
|
|
+ _hubContext.Clients.Group(groupName).SendAsync(method, value, cancellationToken);
|
|
|
|
|
|
#endregion
|
|
|
}
|