|
@@ -39,6 +39,7 @@ using Hotline.Application.Tests.Controller;
|
|
|
using Hotline.Application.Tests.Infrastructure;
|
|
|
using Hotline.Authentications;
|
|
|
using Hotline.FlowEngine.Notifications;
|
|
|
+using Hotline.Application.Handlers.FlowEngine;
|
|
|
|
|
|
namespace Hotline.Application.Tests;
|
|
|
public class Startup
|
|
@@ -118,6 +119,7 @@ public class Startup
|
|
|
callCenterConfiguration.TianRun.Username,
|
|
|
callCenterConfiguration.TianRun.Password);
|
|
|
services.RegisterMediatR(appConfiguration);
|
|
|
+ services.RegisterSignalR(configuration);
|
|
|
|
|
|
// services.AddSenparcWeixinServices(configuration);
|
|
|
AppDomain.CurrentDomain.GetAssemblies().ToList().SelectMany(d => d.GetTypes())
|
|
@@ -182,6 +184,24 @@ public static class StartupHelper
|
|
|
return services;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// SignalR
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="services"></param>
|
|
|
+ /// <param name="configuration"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static IServiceCollection RegisterSignalR(this IServiceCollection services, IConfiguration configuration)
|
|
|
+ {
|
|
|
+ var cacheConfig = configuration.GetRequiredSection("Cache").Get<CacheOptions>();
|
|
|
+ services.AddSignalR().AddStackExchangeRedis($"{cacheConfig.Host}:{cacheConfig.Port}", options =>
|
|
|
+ {
|
|
|
+ options.Configuration.ChannelPrefix = "Hotline:signalr:";
|
|
|
+ options.Configuration.Password = cacheConfig.Password;
|
|
|
+ options.Configuration.DefaultDatabase = cacheConfig.Database;
|
|
|
+ });
|
|
|
+ return services;
|
|
|
+ }
|
|
|
+
|
|
|
public static IServiceCollection AddTestMq(this IServiceCollection services, IConfiguration configuration)
|
|
|
{
|
|
|
MqConfiguration mqConfiguration = configuration.GetSection("MqConfiguration").Get<MqConfiguration>();
|