From ecfaad38242ee13d2f1186fb4bce4f64d1361247 Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Thu, 23 Jul 2026 11:25:35 +0800 Subject: [PATCH] fix: align service channel publish snapshot JSON with preview API Co-authored-by: Cursor --- .../Services/Channels/ServiceChannelService.Helpers.cs | 2 +- src/Oms.Application/Shared/OmsDocHelper.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs b/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs index 6de193d..455fc58 100644 --- a/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs +++ b/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs @@ -246,7 +246,7 @@ public partial class ServiceChannelService PublishUser = string.IsNullOrWhiteSpace(CurrentUser.UserName) ? CurrentUser.GetId().ToString() : CurrentUser.UserName!, PublishTime = DateTime.Now, Description = description, - Content = OmsDocHelper.SerializeJson(snapshot) + Content = OmsDocHelper.SerializeSnapshotJson(snapshot) }); } diff --git a/src/Oms.Application/Shared/OmsDocHelper.cs b/src/Oms.Application/Shared/OmsDocHelper.cs index 513cdd5..9c39b6f 100644 --- a/src/Oms.Application/Shared/OmsDocHelper.cs +++ b/src/Oms.Application/Shared/OmsDocHelper.cs @@ -20,6 +20,7 @@ public static class OmsDocHelper private static readonly JsonSerializerOptions SnapshotJsonOptions = new() { PropertyNameCaseInsensitive = true, + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull };