varianta proiect care merge
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
namespace HealthcareManagerUI.Services.Http;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IRequestHttpService
|
||||
{
|
||||
Task<T> GetAsync<T>(string uri, IDictionary<string, string> headers = null);
|
||||
Task<T> GetByIdAsync<T>(string uri, int id, IDictionary<string, string> headers = null);
|
||||
Task<T> PostAsync<T>(string uri, object data, IDictionary<string, string> headers = null);
|
||||
Task<T> PutAsync<T>(string uri, int id, object data, IDictionary<string, string> headers = null);
|
||||
Task DeleteAsync(string uri, int id, IDictionary<string, string> headers = null);
|
||||
}
|
||||
+2
-2
@@ -3,11 +3,11 @@ using System.Text.Json;
|
||||
|
||||
namespace HealthcareManagerUI.Services.Http;
|
||||
|
||||
public class HttpService : IHttpService
|
||||
public class RequestHttpService : IRequestHttpService
|
||||
{
|
||||
private readonly string _apiKey;
|
||||
|
||||
public HttpService(IConfiguration configuration)
|
||||
public RequestHttpService(IConfiguration configuration)
|
||||
{
|
||||
_apiKey = configuration.GetValue<string>("ApiKey") ?? "NoKey";
|
||||
}
|
||||
Reference in New Issue
Block a user