| | | 1 | | using Newtonsoft.Json.Linq; |
| | | 2 | | |
| | | 3 | | namespace Services.ApiServices.MotexApi; |
| | | 4 | | |
| | | 5 | | /// <summary>Белый список только read-операций Motex API.</summary> |
| | | 6 | | public sealed class MotexDataManager |
| | | 7 | | { |
| | | 8 | | private readonly MotexHttpClient _client; |
| | 98 | 9 | | public MotexDataManager(MotexHttpClient client) => _client = client; |
| | | 10 | | |
| | 0 | 11 | | public Task<JToken> PingAsync(CancellationToken ct = default) => _client.GetAsync("/api/v1/Ping", null, ct); |
| | 24 | 12 | | public Task<JToken> GetAsync(string path, IReadOnlyDictionary<string, string?>? query, CancellationToken ct = defaul |
| | 0 | 13 | | public Task<JToken> SearchAsync(string path, JToken body, CancellationToken ct = default) => _client.PostAsync(path, |
| | 10 | 14 | | public Task<JToken> CreateOrderAsync(JObject request, CancellationToken ct = default) => _client.PostAsync("/api/v1/ |
| | | 15 | | public Task<JToken> GetOrderDetailsAsync(string? id, string? clientOrderNum, CancellationToken ct = default) => |
| | 4 | 16 | | _client.GetAsync("/api/v1/Orders/GetOrderDetails", new Dictionary<string, string?> { ["id"] = id, ["clientOrderN |
| | | 17 | | public Task<JToken> GetOrdersByDateRangeAsync(string? dateFrom, string? dateTo, string? status, int pageNumber, int |
| | 0 | 18 | | _client.GetAsync("/api/v1/Orders/GetOrdersByDateRange", new Dictionary<string, string?> { ["dateFrom"] = dateFro |
| | | 19 | | public Task<JToken> GetOrdersByIdsAsync(IReadOnlyCollection<string> orderIds, CancellationToken ct = default) => |
| | 2 | 20 | | _client.PostAsync("/api/v1/Orders/GetOrdersByIds", new JObject { ["orderIds"] = new JArray(orderIds) }, ct); |
| | | 21 | | } |