23 lines
716 B
C#
23 lines
716 B
C#
using System.Text.Json;
|
|
|
|
namespace Inspectron.Epson.PrintServer.Printers.Utils.KitchenReceipt;
|
|
|
|
public class KitchenReceiptConverterAdapter : IReceiptConverter
|
|
{
|
|
private readonly int _lineWidth;
|
|
private readonly int _bigFontLineWidth;
|
|
|
|
public KitchenReceiptConverterAdapter(int lineWidth, int bigFontLineWidth)
|
|
{
|
|
_lineWidth = lineWidth;
|
|
_bigFontLineWidth = bigFontLineWidth;
|
|
}
|
|
|
|
public List<PrintCommand> Convert(string jsonContent)
|
|
{
|
|
var receipt = JsonSerializer.Deserialize<KitchenReceipt>(jsonContent);
|
|
var converter = new KitchenReceiptConverterKlinglers(_lineWidth, _bigFontLineWidth);
|
|
return converter.ConvertToPrintCommands(receipt);
|
|
}
|
|
}
|