From aad8e086a11ff282562e212901563a65a049db6e Mon Sep 17 00:00:00 2001 From: Antinew <2357729423@qq.com> Date: Tue, 29 Jul 2025 23:20:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix=EF=BC=9A=E6=9C=8D=E5=8A=A1=E5=95=86?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9C=AA=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InterfaceForwardApplicationModule.cs | 3 +++ .../Rabbit/BatchForwardEventHandler.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs b/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs index 14f0345..1b135da 100644 --- a/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs +++ b/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs @@ -7,6 +7,7 @@ using Fake.RabbitMQ; using FreeRedis; using InterfaceForward.Application.Contracts; using InterfaceForward.Application.Helpers; +using InterfaceForward.Application.HostServices; using InterfaceForward.Domain.Shared; using InterfaceForward.Repositories; using Microsoft.Extensions.Configuration; @@ -32,6 +33,8 @@ public class InterfaceForwardApplicationModule:FakeModule }); context.Services.Configure(configuration.GetSection("InterfaceRelay")); + + context.Services.AddHostedService(); var options = configuration.GetSection("Redis").Get(); if (options == null) diff --git a/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs b/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs index 18feae4..1116208 100644 --- a/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs +++ b/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs @@ -10,6 +10,7 @@ using RabbitMQ.Client.Events; namespace InterfaceForward.Application.Rabbit; +[ExposeServices(typeof(IRabbitHandler))] public class BatchForwardEventHandler( InterfaceForwardCommon forwardCommon, RabbitClient rabbitClient, From eb31df2139b51b25cb3631769a0668b9aad49386 Mon Sep 17 00:00:00 2001 From: Antinew <2357729423@qq.com> Date: Wed, 30 Jul 2025 20:20:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat=EF=BC=9A=E6=8F=90=E4=BE=9BParameterPla?= =?UTF-8?q?ceholder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Enum/ParameterPlaceholder.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/InterfaceForward.Domain.Shared/Enum/ParameterPlaceholder.cs diff --git a/src/InterfaceForward.Domain.Shared/Enum/ParameterPlaceholder.cs b/src/InterfaceForward.Domain.Shared/Enum/ParameterPlaceholder.cs new file mode 100644 index 0000000..2d5a29c --- /dev/null +++ b/src/InterfaceForward.Domain.Shared/Enum/ParameterPlaceholder.cs @@ -0,0 +1,19 @@ +using System.ComponentModel; + +namespace InterfaceForward.Domain.Shared.Enum; + +public enum ParameterPlaceholder +{ + [Description("$FromAccount")] + FromAccount = 1, + [Description("$FromBody")] + FromBody, + [Description("$TimeStamp")] + TimeStamp, + [Description("$DateTime")] + DateTime, + [Description("$Url")] + Url, + [Description("$token")] + Token, +} \ No newline at end of file From 5a955d83cd00dde0edac8ec90263efbe0c7c779f Mon Sep 17 00:00:00 2001 From: Antinew <2357729423@qq.com> Date: Thu, 31 Jul 2025 22:24:38 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix=EF=BC=9Arem=20dic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interface/Services/InterfaceMapRepository.cs | 3 +-- .../InterfaceParameterMapOutputValueObject.cs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/InterfaceForward.Repositories/Interface/Services/InterfaceMapRepository.cs b/src/InterfaceForward.Repositories/Interface/Services/InterfaceMapRepository.cs index a54ac04..7eabc43 100644 --- a/src/InterfaceForward.Repositories/Interface/Services/InterfaceMapRepository.cs +++ b/src/InterfaceForward.Repositories/Interface/Services/InterfaceMapRepository.cs @@ -65,14 +65,13 @@ ORDER BY `b`.`Sort` ASC // 因为入参映射有多个 出参映射只有一个(挂在第一个映射) return await Context.SqlQueryable(@$" select `a`.`Id` AS `InterfaceMapDetailId` , `t`.`Id` AS `InterfaceMapId` , `b`.`Id` AS `Id`, b.InterfaceId, `b`.`Alias` AS `Alias` , `b`.`CnName` AS `CnName` -, `e`.`Name` AS `Type`, `b`.`IsInPara` AS `IsInPara` , `b`.`IsRequired` AS `IsRequired` , `b`.`Description` AS `Description` , `d`.`Id` AS `FixedId` +, `b`.`Type` AS `Type2`, `b`.`IsInPara` AS `IsInPara` , `b`.`IsRequired` AS `IsRequired` , `b`.`Description` AS `Description` , `d`.`Id` AS `FixedId` , `d`.`FieldValue` AS `FixedValue` , `a`.`MappedParaId` AS `MapId` , `c`.`Alias` AS `MapAlias`, `c`.`CnName` AS `MapCnName` , `c`.`Description` AS `MapDescription` from t_interface_map t LEFT JOIN `t_parameter` `b` ON {(isInParaMap ? "t.DownStreamId" : "t.UpStreamId")} = `b`.`InterfaceId` and b.IsInPara = {isInParaMap} AND ( `b`.`IsDeleted` = 0 ) AND ( `b`.`Type` <> 12 ) AND ( `b`.`Type` <> 10 ) Left JOIN `t_interface_map_detail` `a` ON ( `t`.`Id` = `a`.`InterfaceMapId` ) and b.id = a.ParaId and a.IsDeleted = 0 Left JOIN `t_parameter` `c` ON ( `a`.`MappedParaId` = `c`.`Id` ) AND ( `c`.`IsDeleted` = 0 ) Left JOIN `t_parameter_fixed` `d` ON d.InterfaceId = b.InterfaceId and `b`.`Alias` = `d`.`FieldName` AND `d`.`FieldPositions` like concat('%', CAST(N'Body' AS CHAR),'%') AND d.IsDeleted = 0 -Left JOIN `t_dictionary` `e` ON (( `b`.`Type` = `e`.`Id` ) AND ( `e`.`Type` = N'ParameterType' )) WHERE {(isInParaMap ? $"t.id in ({ids})" : $"t.id = {mapIds.First()}")} and t.IsDeleted = 0 ORDER BY `b`.`Sort` ASC").ToListAsync(); } diff --git a/src/InterfaceForward.Repositories/Interface/ValueObjects/InterfaceParameterMapOutputValueObject.cs b/src/InterfaceForward.Repositories/Interface/ValueObjects/InterfaceParameterMapOutputValueObject.cs index fcd8595..2a8eff4 100644 --- a/src/InterfaceForward.Repositories/Interface/ValueObjects/InterfaceParameterMapOutputValueObject.cs +++ b/src/InterfaceForward.Repositories/Interface/ValueObjects/InterfaceParameterMapOutputValueObject.cs @@ -1,4 +1,7 @@ -namespace InterfaceForward.Repositories.Interface.ValueObjects; +using InterfaceForward.Domain.Shared.Enum; +using InterfaceForward.Domain.Shared.Helpers; + +namespace InterfaceForward.Repositories.Interface.ValueObjects; public class InterfaceParameterMapOutputValueObject { @@ -35,7 +38,12 @@ public class InterfaceParameterMapOutputValueObject /// /// 参数类型 /// - public string Type { get; set; } + public string Type => Type2.GetDescription(); + + /// + /// 参数类型 + /// + public ParameterType Type2 { get; set; } /// /// 是否入参