using OrdersManagementDataModel.Dtos; namespace OrdersManagement.Services; public class HangfireService( IHttpClientFactory httpClientFactory, CustomAuthenticationStateProvider authenticationStateProvider) : ServiceBase(httpClientFactory, authenticationStateProvider) { public async Task?> GetTaskSchedulersAsync() { return await GetListAsync("api/HangfireJobs/"); } public async Task GetTaskSchedulerAsync(Guid id) { return await GetEntityAsync($"api/HangfireJobs/{id}"); } public async Task AddTaskSchedulerAsync(TaskSchedulerDto taskSchedulerDto) { HttpResponseMessage responseMessage = await PostAsJsonAsync("api/HangfireJobs/add", taskSchedulerDto); return responseMessage.IsSuccessStatusCode ? 1 : 0; } public async Task DeleteTaskSchedulerAsync(TaskSchedulerDto taskSchedulerDto) { HttpResponseMessage responseMessage = await PostAsJsonAsync("api/HangfireJobs/delete", taskSchedulerDto); return responseMessage.IsSuccessStatusCode ? 1 : 0; } }