2024-05-07 11:01:57 +03:30
|
|
|
|
namespace Netina.AdminPanel.PWA.Services.RestServices;
|
2024-01-22 17:26:29 +03:30
|
|
|
|
|
|
|
|
|
|
public class RestWrapper : IRestWrapper
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
private static RefitSettings setting = new RefitSettings(new NewtonsoftJsonContentSerializer(new JsonSerializerSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
Formatting = Newtonsoft.Json.Formatting.Indented,
|
|
|
|
|
|
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,
|
2024-03-01 16:16:05 +03:30
|
|
|
|
|
2024-01-22 17:26:29 +03:30
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
public ICrudApiRest<T, TKey> CrudApiRest<T, TKey>(string address) where T : class
|
|
|
|
|
|
{
|
|
|
|
|
|
return RestService.For<ICrudApiRest<T, TKey>>(address, setting);
|
|
|
|
|
|
}
|
|
|
|
|
|
public ICrudDtoApiRest<T, TDto, TKey> CrudDtoApiRest<T, TDto, TKey>(string address) where T : class where TDto : class
|
|
|
|
|
|
{
|
|
|
|
|
|
return RestService.For<ICrudDtoApiRest<T, TDto, TKey>>(address, setting);
|
|
|
|
|
|
}
|
|
|
|
|
|
public IAuthRestApi AuthRestApi => RestService.For<IAuthRestApi>(Address.AuthController, setting);
|
|
|
|
|
|
public IUserRestApi UserRestApi => RestService.For<IUserRestApi>(Address.UserController, setting);
|
2024-01-28 20:51:50 +03:30
|
|
|
|
public IProductCategoryRestApi ProductCategoryRestApi => RestService.For<IProductCategoryRestApi>(Address.ProductCategoryController, setting);
|
|
|
|
|
|
public IProductRestApi ProductRestApi => RestService.For<IProductRestApi>(Address.ProductController, setting);
|
2024-01-30 02:33:27 +03:30
|
|
|
|
public IBrandRestApi BrandRestApi => RestService.For<IBrandRestApi>(Address.BrandController, setting);
|
|
|
|
|
|
public IFileRestApi FileRestApi => RestService.For<IFileRestApi>(Address.FileController, setting);
|
2024-01-30 19:35:44 +03:30
|
|
|
|
public IBlogRestApi BlogRestApi => RestService.For<IBlogRestApi>(Address.BlogController, setting);
|
2024-02-04 16:52:32 +03:30
|
|
|
|
public IDiscountRestApi DiscountRest => RestService.For<IDiscountRestApi>(Address.DiscountController, setting);
|
2024-01-30 19:35:44 +03:30
|
|
|
|
public IBlogCategoryRestApi BlogCategoryRestApi => RestService.For<IBlogCategoryRestApi>(Address.BlogCategoryController, setting);
|
2024-02-17 15:39:59 +03:30
|
|
|
|
public IRoleRestApi RoleRestApi => RestService.For<IRoleRestApi>(Address.RoleController, setting);
|
|
|
|
|
|
public IOrderRestApi OrderRestApi => RestService.For<IOrderRestApi>(Address.OrderController, setting);
|
|
|
|
|
|
public IPaymentRestApi PaymentRestApi => RestService.For<IPaymentRestApi>(Address.PaymentController, setting);
|
|
|
|
|
|
public IPageRestApi PageRestApi => RestService.For<IPageRestApi>(Address.PageController, setting);
|
|
|
|
|
|
public IScraperRestApi ScraperRestApi => RestService.For<IScraperRestApi>(Address.ScraperController, setting);
|
2024-04-03 10:40:42 +03:30
|
|
|
|
public ISettingRestApi SettingRestApi => RestService.For<ISettingRestApi>(Address.SettingController, setting);
|
2024-02-25 18:21:01 +03:30
|
|
|
|
public IDashboardApiRest DashboardApiRest => RestService.For<IDashboardApiRest>(Address.DashboardController, setting);
|
2024-04-03 10:40:42 +03:30
|
|
|
|
public IDistrictApiRest DistrictApiRest => RestService.For<IDistrictApiRest>(Address.DistrictController, setting);
|
2024-01-22 17:26:29 +03:30
|
|
|
|
}
|