dss 2 سال پیش
والد
کامیت
891d5c5c18
2فایلهای تغییر یافته به همراه10 افزوده شده و 5 حذف شده
  1. 5 0
      src/CallCenter.Api/Controllers/TestController.cs
  2. 5 5
      src/CallCenter.Api/StartupExtensions.cs

+ 5 - 0
src/CallCenter.Api/Controllers/TestController.cs

@@ -120,6 +120,11 @@ namespace CallCenter.Api.Controllers
             await _realtimeService.AnsweredAsync(_sessionContext.RequiredUserId, new AnseredDto() { Id = "123", From = "13408389849", To = "65123495" }, HttpContext.RequestAborted);
         }
 
+        /// <summary>
+        /// signalR测试(method:Bye)
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet("bye")]
         public async Task ByeTest()
         {
             await _realtimeService.ByeAsync(_sessionContext.RequiredUserId, new ByeDto() { Id = "123" }, HttpContext.RequestAborted);

+ 5 - 5
src/CallCenter.Api/StartupExtensions.cs

@@ -136,11 +136,11 @@ internal static class StartupExtensions
             c.AddSecurityRequirement(requirement);
         });
 
-        ////signalR
-        //builder.Services.AddSignalR().AddStackExchangeRedis(configuration.GetConnectionString("Redis"), options =>
-        //{
-        //    options.Configuration.ChannelPrefix = "callcenter:signalR:";
-        //});
+        //signalR
+        builder.Services.AddSignalR().AddStackExchangeRedis(configuration.GetConnectionString("Redis"), options =>
+        {
+            options.Configuration.ChannelPrefix = "callcenter:signalR:";
+        });
 
         /* CORS */
         services.AddCors(options =>