2024-08-09 21:55:16 +03:30
|
|
|
|
using Netina.Infrastructure.Models;
|
2024-01-02 19:08:39 +03:30
|
|
|
|
|
2024-04-16 20:01:34 +03:30
|
|
|
|
namespace Netina.Infrastructure.RestServices;
|
2024-01-02 19:08:39 +03:30
|
|
|
|
|
|
|
|
|
|
public interface IRestApiWrapper : IScopedDependency
|
|
|
|
|
|
{
|
|
|
|
|
|
IKaveNegarRestApi KaveNegarRestApi { get; }
|
2024-02-12 10:46:18 +03:30
|
|
|
|
IZarinpalRestApi ZarinpalRestApi { get; }
|
2024-02-15 10:39:00 +03:30
|
|
|
|
IDigikalaRestApi DigikalaRestApi { get; }
|
2024-02-25 18:21:01 +03:30
|
|
|
|
IFileRestApi FileRestApi(string address);
|
2024-01-02 19:08:39 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class RestApiWrapper : IRestApiWrapper
|
|
|
|
|
|
{
|
|
|
|
|
|
public IKaveNegarRestApi KaveNegarRestApi => RestService.For<IKaveNegarRestApi>(RestAddress.BaseKaveNegar);
|
2024-02-12 10:46:18 +03:30
|
|
|
|
public IZarinpalRestApi ZarinpalRestApi => RestService.For<IZarinpalRestApi>(RestAddress.BaseZarinpal);
|
2024-02-15 10:39:00 +03:30
|
|
|
|
public IDigikalaRestApi DigikalaRestApi => RestService.For<IDigikalaRestApi>(RestAddress.DigikalaApi);
|
2024-02-25 18:21:01 +03:30
|
|
|
|
|
|
|
|
|
|
public IFileRestApi FileRestApi(string address)
|
|
|
|
|
|
{
|
|
|
|
|
|
return RestService.For<IFileRestApi>(address);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-02 19:08:39 +03:30
|
|
|
|
}
|