add-track: 推送轨迹中请求接口通获取接口结构

This commit is contained in:
hardstylewyl 2024-12-19 15:03:08 +08:00
parent f694364754
commit e0c18bda20

View File

@ -4,6 +4,7 @@ using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using SJZY.Expand.ABP.Core.PublicMethords;
using SJZY.InterfaceRelay.Application.Contracts;
using SJZY.OTel;
using SJZY.Track.Application.Contract.Dtos.TrackPush;
using SJZY.Track.Application.Contract.Events;
using SJZY.Track.Application.Contract.Services;
@ -380,11 +381,14 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
/// <returns></returns>
private async Task<List<string>> GetExtraParamNamesAsync(string subSystemCode)
{
using var span = ActivityHelper.CreateSpanActivity("开始请求接口通,接口结构");
using (Track2InterfaceRelaySubSystemContext.Use(
new Track2InterfaceRelaySubSystemContext(subSystemCode)))
{
var res = await _httpClientProxy.Service.GetSystemInterfaceByIdAsync(_options.CurrentValue.PushTrackInterfaceCode, _options.CurrentValue.PushTrackInterfaceId);
if (res == null) return new List<string>();
span.SetTag("request-GetSystemInterfaceByIdAsync", $"{subSystemCode},{_options.CurrentValue.PushTrackInterfaceCode},{_options.CurrentValue.PushTrackInterfaceId}");
span.SetTag("response-GetSystemInterfaceByIdAsync", res.ToJson());
return res.InParameterList
.Where(x => x.Alias.StartsWith(_options.CurrentValue.PushTrackItemParamAliasPrefix))
.Select(x => x.Name)