mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 13:26:30 +00:00
fix hardware service
This commit is contained in:
@@ -11,10 +11,10 @@ public interface IAzaionApi
|
||||
ApiCredentials Credentials { get; }
|
||||
User CurrentUser { get; }
|
||||
void UpdateOffsets(UserQueueOffsets offsets);
|
||||
Stream GetResource(string filename, string folder);
|
||||
//Stream GetResource(string filename, string folder);
|
||||
}
|
||||
|
||||
public class AzaionApi(HttpClient client, ICache cache, ApiCredentials credentials, IHardwareService hardwareService) : IAzaionApi
|
||||
public class AzaionApi(HttpClient client, ICache cache, ApiCredentials credentials) : IAzaionApi
|
||||
{
|
||||
private string _jwtToken = null!;
|
||||
const string APP_JSON = "application/json";
|
||||
@@ -32,17 +32,6 @@ public class AzaionApi(HttpClient client, ICache cache, ApiCredentials credentia
|
||||
}
|
||||
}
|
||||
|
||||
public Stream GetResource(string filename, string folder)
|
||||
{
|
||||
var hardware = cache.GetFromCache(SecurityConstants.HARDWARE_INFO_KEY, hardwareService.GetHardware);
|
||||
|
||||
var response = Send(new HttpRequestMessage(HttpMethod.Post, $"/resources/get/{folder}")
|
||||
{
|
||||
Content = new StringContent(JsonConvert.SerializeObject(new { filename, credentials.Password, hardware }), Encoding.UTF8, APP_JSON)
|
||||
});
|
||||
return response.Content.ReadAsStream();
|
||||
}
|
||||
|
||||
public void UpdateOffsets(UserQueueOffsets offsets)
|
||||
{
|
||||
Put($"/users/queue-offsets/{CurrentUser.Email}", offsets);
|
||||
|
||||
Reference in New Issue
Block a user