namespace Netina.AdminPanel.PWA.Services.RestServices; public class RestWrapper(IConfiguration configuration) : IRestWrapper { private string baseApiAddress = configuration.GetValue("ApiUrl") ?? string.Empty; private static RefitSettings setting = new RefitSettings(new NewtonsoftJsonContentSerializer(new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore, })); public ICrudApiRest CrudApiRest(string address) where T : class { return RestService.For>(baseApiAddress + address, setting); } public ICrudDtoApiRest CrudDtoApiRest(string address) where T : class where TDto : class { return RestService.For>(baseApiAddress + address, setting); } public IAuthRestApi AuthRestApi => RestService.For($"{baseApiAddress}{Address.AuthController}", setting); public IUserRestApi UserRestApi => RestService.For($"{baseApiAddress}{Address.UserController}", setting); public IProductCategoryRestApi ProductCategoryRestApi => RestService.For($"{baseApiAddress}{Address.ProductCategoryController}", setting); public IProductRestApi ProductRestApi => RestService.For($"{baseApiAddress}{Address.ProductController}", setting); public IBrandRestApi BrandRestApi => RestService.For($"{baseApiAddress}{Address.BrandController}", setting); public IFileRestApi FileRestApi => RestService.For($"{baseApiAddress}{Address.FileController}", setting); public IBlogRestApi BlogRestApi => RestService.For($"{baseApiAddress}{Address.BlogController}", setting); public IDiscountRestApi DiscountRest => RestService.For($"{baseApiAddress}{Address.DiscountController}",setting); public IReviewRestApi ReviewRestApi => RestService.For($"{baseApiAddress}{Address.CommentController}", setting); public IBlogCategoryRestApi BlogCategoryRestApi => RestService.For($"{baseApiAddress}{Address.BlogCategoryController}", setting); public IRoleRestApi RoleRestApi => RestService.For($"{baseApiAddress}{Address.RoleController}", setting); public IOrderRestApi OrderRestApi => RestService.For($"{baseApiAddress}{Address.OrderController}", setting); public IPaymentRestApi PaymentRestApi => RestService.For($"{baseApiAddress}{Address.PaymentController}", setting); public IPageRestApi PageRestApi => RestService.For($"{baseApiAddress}{Address.PageController}", setting); public IScraperRestApi ScraperRestApi => RestService.For($"{baseApiAddress}{Address.ScraperController}", setting); public ISettingRestApi SettingRestApi => RestService.For($"{baseApiAddress}{Address.SettingController}", setting); public IDashboardApiRest DashboardApiRest => RestService.For($"{baseApiAddress}{Address.DashboardController}", setting); public IDistrictApiRest DistrictApiRest => RestService.For($"{baseApiAddress}{Address.DistrictController}", setting); public IFaqApiRest FaqApiRest => RestService.For($"{baseApiAddress}{Address.FaqController}", setting); }