From 99828d4b91b35b1c88a874a943ba99db75085bb3 Mon Sep 17 00:00:00 2001 From: xiaolipro <2357729423@qq.com> Date: Thu, 25 Sep 2025 11:40:57 +0800 Subject: [PATCH] req itfx --- .../Track2InterfaceRelay/InterfaceForwardService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/TrackCenter.Application/Track2InterfaceRelay/InterfaceForwardService.cs b/src/TrackCenter.Application/Track2InterfaceRelay/InterfaceForwardService.cs index 87b5742e..dbf80a4c 100644 --- a/src/TrackCenter.Application/Track2InterfaceRelay/InterfaceForwardService.cs +++ b/src/TrackCenter.Application/Track2InterfaceRelay/InterfaceForwardService.cs @@ -26,6 +26,7 @@ public class InterfaceForwardService : ITransientDependency var body = data.ToJson(); var content = new StringContent(body); + content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); if (Track2InterfaceRelayAppContext.Current == null) { throw new BusinessException(message: $"请在{nameof(Track2InterfaceRelayAppContext)}中调用接口通"); @@ -40,10 +41,17 @@ public class InterfaceForwardService : ITransientDependency content.Headers.Add(nameof(InterfaceForwardOptions.AppKey), key); content.Headers.Add(nameof(InterfaceForwardOptions.AppSecret), secret); + content.Headers.Add(nameof(resSubscribeName), resSubscribeName); + content.Headers.Add(nameof(attach), attach); + content.Headers.Add(nameof(isReturnMessage), isReturnMessage.ToString()); - using var response = await client.PostAsync("InterfaceForward/BatchForwardThenPushToQueue", content); + using var response = await client.PostAsync($"InterfaceForward/BatchForwardThenPushToQueue?upStreamCode={upStreamCode}&serviceProvidercode={serviceProviderCode}", content); var res = await response.Content.ReadAsStringAsync(); + if (!response.IsSuccessStatusCode) + { + throw new BusinessException(message: $"返回的状态码有问题: {response.StatusCode}, {response.ReasonPhrase}"); + } return res.ToObject()!; }