committed by
GitHub
1 changed files with 28 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||||
|
using LINGYUN.Abp.Identity.Notifications; |
||||
|
using LINGYUN.Abp.Notifications; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Domain.Entities.Events; |
||||
|
using Volo.Abp.EventBus; |
||||
|
using Volo.Abp.Users; |
||||
|
|
||||
|
namespace LY.MicroService.RealtimeMessage.EventBus; |
||||
|
|
||||
|
public class UserSubscribeSessionExpirationEventHandler : ILocalEventHandler<EntityCreatedEventData<UserEto>>, ITransientDependency |
||||
|
{ |
||||
|
private readonly INotificationSubscriptionManager _notificationSubscriptionManager; |
||||
|
|
||||
|
public UserSubscribeSessionExpirationEventHandler(INotificationSubscriptionManager notificationSubscriptionManager) |
||||
|
{ |
||||
|
_notificationSubscriptionManager = notificationSubscriptionManager; |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleEventAsync(EntityCreatedEventData<UserEto> eventData) |
||||
|
{ |
||||
|
await _notificationSubscriptionManager |
||||
|
.SubscribeAsync( |
||||
|
eventData.Entity.TenantId, |
||||
|
new UserIdentifier(eventData.Entity.Id, eventData.Entity.UserName), |
||||
|
IdentityNotificationNames.Session.ExpirationSession); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue