feat(AIHITMainLoader, API, JobAutoControl, Master): изменен метод отправки сообщений в RabbitMq
This commit is contained in:
@@ -3,8 +3,8 @@ using Microsoft.Extensions.Logging;
|
||||
using PARR.AIHITMainLoader.Models;
|
||||
using PARR.AIHITMainLoader.Services;
|
||||
using PARR.AIHITMainLoader.Settings;
|
||||
using PARR.BLL.Domain.Mq;
|
||||
using PARR.BLL.Services.Interfaces;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace PARR.AIHITMainLoader
|
||||
@@ -19,6 +19,11 @@ namespace PARR.AIHITMainLoader
|
||||
private readonly IMqService mqService;
|
||||
private readonly IServiceProvider serviceProvider;
|
||||
|
||||
private static readonly JsonSerializerOptions jsonOptions = new JsonSerializerOptions
|
||||
{
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
|
||||
};
|
||||
|
||||
public AihitMainLoader(
|
||||
ILogger<AihitMainLoader> logger,
|
||||
IIntervalService intervalService,
|
||||
@@ -82,7 +87,7 @@ namespace PARR.AIHITMainLoader
|
||||
var mainData = item.ToMainData();
|
||||
if (mainData == null) continue;
|
||||
|
||||
var json = JsonSerializer.Serialize(mainData);
|
||||
var json = JsonSerializer.Serialize(mainData, jsonOptions);
|
||||
currentBatch.Add(json);
|
||||
|
||||
// Отправка, если набрали полный пакет
|
||||
|
||||
Reference in New Issue
Block a user