add common json options

This commit is contained in:
2023-10-23 17:39:27 +08:00
parent a3fff03ff6
commit f98cc6ff5a
5 changed files with 29 additions and 50 deletions
+2 -7
View File
@@ -5,6 +5,7 @@ using System.Text.Json;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using RabbitMQ.Client.Events;
using SimApi.Helpers;
namespace SimApi;
@@ -35,13 +36,7 @@ public partial class Synapse
{
mt.Invoke(callClass, pt == typeof(string)
? new object[] { reqBody }
: new[]
{
JsonSerializer.Deserialize(reqBody, pt, new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
})
});
: new[] { JsonSerializer.Deserialize(reqBody, pt, SimApiUtil.JsonOption) });
EventServerChannel.BasicAck(ea.DeliveryTag, false);
}
catch (Exception e)