feat(esppOrderManager): вынесен шаблон поля Решение в настройки.

This commit is contained in:
Mikhail Trubnikov
2023-11-21 14:37:41 +10:00
parent f85b97f60a
commit 9532ee8487
7 changed files with 54 additions and 31 deletions

View File

@@ -4,7 +4,9 @@ using PARR.EsppApi.Models;
using PARR.EsppApi.Models.Query;
using PARR.EsppApi.Requests;
using PARR.EsppApi.Settings;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Unicode;
namespace PARR.EsppApi
{
@@ -138,18 +140,6 @@ namespace PARR.EsppApi
}
/// <summary>
/// Убирает из запроса запрещенные символы
/// </summary>
/// <returns></returns>
private string QuerySanitize(string str)
{
//str = str.Replace("\r\n", "<br/>");
return str;
}
/// <summary>
/// Формирует запрос в ЕСПП из строки
/// </summary>
@@ -173,7 +163,8 @@ namespace PARR.EsppApi
/// <returns></returns>
private string GenerateRequest<T>(EsppOperationsEnum operation, T jsonQuery)
{
var strQuery = JsonSerializer.Serialize(jsonQuery);
var jsonOptions = new JsonSerializerOptions { Encoder = JavaScriptEncoder.Create(UnicodeRanges.All, UnicodeRanges.Cyrillic) };
var strQuery = JsonSerializer.Serialize(jsonQuery, jsonOptions);
return GenerateRequest(operation, strQuery);
}