optimize:优化服务商mq日志

This commit is contained in:
xiaolipro 2026-01-15 12:12:20 +08:00
parent c620256082
commit f0d96c0cb3
2 changed files with 11 additions and 6 deletions

View File

@ -90,6 +90,11 @@ public class BatchForwardEventHandler(
{
var data = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(replayEvent);
rabbitClient.Publish(GlobalConst.InterfaceRelayExchange, @event.ResSubscribeName, data);
context.ServiceProviderRequestLog.Response2 = replayEvent.ToJson();
// 写服务商日志
await logRepository.AddLogAsync(context.ServiceProviderRequestLog);
}
}
}

View File

@ -362,10 +362,6 @@ public class InterfaceForwardCommon(
if (isMulti) return response; // 一对多不在这映射
var res = await flow.OutParamRestructure(context, response);
if (context.Feature.IsWait)
{
context.ServiceProviderRequestLog.Response2 = res.ToJson();
}
return res;
}
@ -386,8 +382,12 @@ public class InterfaceForwardCommon(
// 关联当前服务商日志
logRepository.ServiceProviderRequestLog = context.ServiceProviderRequestLog;
// 写服务商日志
await logRepository.AddLogAsync(context.ServiceProviderRequestLog);
if (!context.Feature.IsWait) // 批量case服务商日志延迟到 handle中处理
{
// 写服务商日志
await logRepository.AddLogAsync(context.ServiceProviderRequestLog);
}
}
}