2024-04-17 16:19:40 +03:30
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
using Refit;
|
2024-01-13 13:05:37 +03:30
|
|
|
|
|
2024-04-17 12:24:47 +03:30
|
|
|
|
namespace Netina.WordPressDBConverter.Services.RestServices;
|
2024-01-13 13:05:37 +03:30
|
|
|
|
|
|
|
|
|
|
public class RestWrapper
|
|
|
|
|
|
{
|
2024-04-17 16:19:40 +03:30
|
|
|
|
private static RefitSettings setting = new RefitSettings(new NewtonsoftJsonContentSerializer(new JsonSerializerSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
Formatting = Newtonsoft.Json.Formatting.Indented,
|
|
|
|
|
|
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,
|
|
|
|
|
|
|
|
|
|
|
|
}));
|
2024-01-13 13:05:37 +03:30
|
|
|
|
private static RestWrapper? _instance;
|
|
|
|
|
|
public static RestWrapper Instance => _instance = _instance ?? new RestWrapper();
|
|
|
|
|
|
|
2024-04-17 16:19:40 +03:30
|
|
|
|
public ISeedRestApi SeedRestApi => RestService.For<ISeedRestApi>("http://localhost:32770/api/seed", setting);
|
|
|
|
|
|
public IUploadRestApi UploadRestApi => RestService.For<IUploadRestApi>("http://localhost:32770/api/file", setting);
|
2024-01-13 13:05:37 +03:30
|
|
|
|
}
|