fix: align service channel publish snapshot JSON with preview API

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-07-23 11:25:35 +08:00
parent a4d7c89e44
commit ecfaad3824
2 changed files with 2 additions and 1 deletions

View File

@ -246,7 +246,7 @@ public partial class ServiceChannelService
PublishUser = string.IsNullOrWhiteSpace(CurrentUser.UserName) ? CurrentUser.GetId<int>().ToString() : CurrentUser.UserName!,
PublishTime = DateTime.Now,
Description = description,
Content = OmsDocHelper.SerializeJson(snapshot)
Content = OmsDocHelper.SerializeSnapshotJson(snapshot)
});
}

View File

@ -20,6 +20,7 @@ public static class OmsDocHelper
private static readonly JsonSerializerOptions SnapshotJsonOptions = new()
{
PropertyNameCaseInsensitive = true,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
};