Api-PWA/DocuMed.Infrastructure/RestServices/RestApiWrapper.cs

21 lines
709 B
C#
Raw Normal View History

using Newtonsoft.Json;
namespace DocuMed.Infrastructure.RestServices;
2023-10-19 21:28:09 +03:30
public interface IRestApiWrapper : IScopedDependency
{
IKaveNegarRestApi KaveNegarRestApi { get; }
IMetisRestApi MetisRestApi { get; }
2023-10-19 21:28:09 +03:30
}
public class RestApiWrapper : IRestApiWrapper
{
private static readonly RefitSettings setting = new RefitSettings(new NewtonsoftJsonContentSerializer(new JsonSerializerSettings
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
}));
2023-10-19 21:28:09 +03:30
public IKaveNegarRestApi KaveNegarRestApi => RestService.For<IKaveNegarRestApi>(RestAddress.BaseKaveNegar);
public IMetisRestApi MetisRestApi => RestService.For<IMetisRestApi>("https://api.metisai.ir/api/v1", setting);
2023-10-19 21:28:09 +03:30
}