这是基于vue-vben-admin 模板适用于abp Vnext的前端管理项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1.8 KiB

LINGYUN.Abp.RealTime

Introduction

LINGYUN.Abp.RealTime is a real-time communication foundation module that provides infrastructure for real-time message delivery. This module is mainly used for handling real-time notifications, messages, and event delivery.

Features

  • Real-time event delivery infrastructure
  • Support for localized string handling
  • Distributed event integration
  • Extensible event handling mechanism

Installation

dotnet add package LINGYUN.Abp.RealTime

Usage

  1. Add [DependsOn(typeof(AbpRealTimeModule))] to your module class.
[DependsOn(typeof(AbpRealTimeModule))]
public class YourModule : AbpModule
{
    // ...
}
  1. Create real-time event data transfer object:
public class YourRealTimeEto : RealTimeEto<YourData>
{
    public YourRealTimeEto(YourData data) 
        : base(data)
    {
    }
}
  1. Use localized strings:
public class LocalizedMessage
{
    private readonly LocalizableStringInfo _localizableString;

    public LocalizedMessage()
    {
        _localizableString = new LocalizableStringInfo(
            "YourResource",
            "MessageKey",
            new Dictionary<object, object>
            {
                { "param1", "value1" }
            });
    }
}

Advanced Usage

1. Custom Real-Time Events

[EventName("your-custom-event")]
public class CustomRealTimeEto : RealTimeEto<CustomData>
{
    public CustomRealTimeEto(CustomData data) 
        : base(data)
    {
    }
}

2. Real-Time Event Handling

public class YourRealTimeEventHandler : 
    IDistributedEventHandler<YourRealTimeEto>,
    ITransientDependency
{
    public async Task HandleEventAsync(YourRealTimeEto eventData)
    {
        // Handle real-time event
    }
}