xf hai 1 ano
pai
achega
1e6c51e46c
Modificáronse 1 ficheiros con 18 adicións e 0 borrados
  1. 18 0
      src/Hotline.Api/Controllers/TestController.cs

+ 18 - 0
src/Hotline.Api/Controllers/TestController.cs

@@ -7,6 +7,7 @@ using Google.Protobuf.WellKnownTypes;
 using Hotline.Ai.Visit;
 using Hotline.Application.ExportExcel;
 using Hotline.CallCenter.BlackLists;
+using Hotline.CallCenter.Calls;
 using Hotline.CallCenter.Devices;
 using Hotline.CallCenter.Ivrs;
 using Hotline.FlowEngine.WorkflowModules;
@@ -336,4 +337,21 @@ public class TestController : BaseController
         var publicKey = keyList[1];
         return $"{publicKey} \r\n {privateKey}";
     }
+
+    [HttpGet("dl")]
+    [AllowAnonymous]
+    public async Task F([FromServices] IRepository<TrCallRecord> callRepository)
+    {
+        var calls = await callRepository.Queryable()
+            .Where(d=> !string.IsNullOrEmpty( d.RecordingFileUrl))
+            .ToListAsync(HttpContext.RequestAborted);
+        foreach (var call in calls)
+        {
+            var uri = new Uri(call.RecordingFileUrl);
+            call.RecordingBaseAddress = $"{uri.Scheme}://{uri.Host}:{uri.Port}";
+            call.RecordingAbsolutePath = uri.AbsolutePath;
+        }
+
+        await callRepository.UpdateRangeAsync(calls, HttpContext.RequestAborted);
+    }
 }