diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksManagementApplicationMapperProfile.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksManagementApplicationMapperProfile.cs index 11ab195a0..868ff31d6 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksManagementApplicationMapperProfile.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksManagementApplicationMapperProfile.cs @@ -1,4 +1,7 @@ using AutoMapper; +using System.Collections.Generic; +using System; +using Newtonsoft.Json; namespace LINGYUN.Abp.WebhooksManagement; @@ -7,6 +10,36 @@ public class WebhooksManagementApplicationMapperProfile : Profile public WebhooksManagementApplicationMapperProfile() { CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dto => dto.RequestHeaders, map => map.MapFrom((src, dto) => + { + var result = new Dictionary(); + + if (src.RequestHeaders.IsNullOrWhiteSpace()) + { + try + { + result = JsonConvert.DeserializeObject< Dictionary>(src.RequestHeaders); + } + catch { } + } + + return result; + })) + .ForMember(dto => dto.ResponseHeaders, map => map.MapFrom((src, dto) => + { + var result = new Dictionary(); + + if (src.ResponseHeaders.IsNullOrWhiteSpace()) + { + try + { + result = JsonConvert.DeserializeObject>(src.ResponseHeaders); + } + catch { } + } + + return result; + })); } }