mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[store] other use default client factory
This commit is contained in:
@@ -9,15 +9,12 @@ public abstract class AnimalAsAService : IRandomMediaService
|
||||
private readonly HttpClient _httpClient;
|
||||
public abstract StoreItem StoreItem { get; }
|
||||
|
||||
protected AnimalAsAService(Uri baseAddress)
|
||||
protected AnimalAsAService(IHttpClientFactory factory, Uri baseAddress)
|
||||
{
|
||||
_httpClient = new HttpClient
|
||||
{
|
||||
BaseAddress = baseAddress
|
||||
};
|
||||
_httpClient = factory.CreateClient();
|
||||
_httpClient.BaseAddress = baseAddress;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<RandomMedia> GetRandomMediaAsync()
|
||||
{
|
||||
var resp = await _httpClient.GetAsync("images/search");
|
||||
|
||||
Reference in New Issue
Block a user