From 4ab0bcef19b78f9ae0339d4b78de68a7297f7683 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期四, 28 八月 2025 14:54:15 +0800
Subject: [PATCH] Merge branch 'master' of http://120.26.58.240:8888/r/ApiFlexJob

---
 FlexJobApi.CommonServer.Application/LogRecords/Commands/ResendResourceCommandHandler.cs |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/FlexJobApi.CommonServer.Application/LogRecords/Commands/ResendResourceCommandHandler.cs b/FlexJobApi.CommonServer.Application/LogRecords/Commands/ResendResourceCommandHandler.cs
index 17662b7..80a8d77 100644
--- a/FlexJobApi.CommonServer.Application/LogRecords/Commands/ResendResourceCommandHandler.cs
+++ b/FlexJobApi.CommonServer.Application/LogRecords/Commands/ResendResourceCommandHandler.cs
@@ -17,14 +17,12 @@
     /// </summary>
     public class ResendResourceCommandHandler(
             IRepository<ResourceLog, LogDbContextLocator> repResourceLog,
-            IRepository<Resource> repResource,
-            ResourceHttpUtils resourceHttpUtils
+            IRepository<Resource> repResource
         ) :
         IRequestHandler<ResendResourceCommand, string>
     {
         private readonly IRepository<ResourceLog, LogDbContextLocator> repResourceLog = repResourceLog;
         private readonly IRepository<Resource> repResource = repResource;
-        private readonly ResourceHttpUtils resourceHttpUtils = resourceHttpUtils;
 
         /// <summary>
         /// 閲嶆柊鍙戦�佽祫婧�
@@ -47,7 +45,14 @@
             if (log == null) throw Oops.Oh(EnumErrorCodeType.s404, "鏃ュ織");
             var resource = await repResource.AsQueryable().AsNoTracking()
                 .Where(it => it.Method == log.Method && it.Route == log.Path)
+                .Select(it => new
+                {
+                    it.ServiceName,
+                    it.Route,
+                    it.Method
+                })
                 .FirstOrDefaultAsync();
+            if (resource == null) throw Oops.Oh(EnumErrorCodeType.s404, "璧勬簮");
             var paramters = log.Request
                 .JsonTo(new
                 {
@@ -55,7 +60,7 @@
                 })
                 .request
                 .ToJson();
-            var result = await resourceHttpUtils.SendHttpAsync(resource, paramters);
+            var result = await paramters.SendHttpAsync(resource.ServiceName, resource.Route, resource.Method);
             return result;
         }
     }

--
Gitblit v1.9.1