Add project files.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Net.Http.Json;
|
||||
using Inspectron.Epson.PrintServer.ConfigurationSources;
|
||||
|
||||
namespace Inspectron.Epson.PrintServer.WorkAreaSources;
|
||||
|
||||
public class JamesWorkAreaSource: IWorkAreasSource
|
||||
{
|
||||
private readonly EpsonPrintServiceConfiguration _configuration;
|
||||
|
||||
public JamesWorkAreaSource(EpsonPrintServiceConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public async Task<List<WorkArea>> GetWorkAreasAsync()
|
||||
{
|
||||
var url = $@"https://api.stage.gastrojames.ch/api/Restaurant/{_configuration.RestaurantId}/work-areas";
|
||||
|
||||
HttpClient client = new();
|
||||
var response = await client.GetFromJsonAsync<List<WorkArea>>(url);
|
||||
response.Add(new WorkArea()
|
||||
{
|
||||
Id = "print-receipt",
|
||||
Name = "Receipt"
|
||||
});
|
||||
return response!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user