sunpengfei
2025-08-28 6ad4db7d45eeaec5617f511010343258f245e5d4
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;
        }
    }