Добавил два маршрутка для API

Для получение инфомации о принтере
Добавление принтера (не реализован)
This commit is contained in:
Hukuta committed 2026-05-30 10:56:43 +09:00
1 parent c229049791
commit 3eea43e540
13 files changed
+247 -5

No files matched your search

@@ -0,0 +1,27 @@
using System.Xml.Linq;
namespace CartriX.Api.Controllers.Cartridge
{
public static class PrinterMap
{
public static Shared.Models.Printer.PrinterItem ToItem(this Entities.Printer printer) => new()
{
Name = printer.Name,
IpAddressOrHostname = printer.IpAddressOrHostname,
CountPrintedAllTime = printer.CountPrintedAllTime,
OidForQueryCountPrintedAllTime = printer.OidForQueryCountPrintedAllTime,
PrintTypeName = printer.PrintType.Name,
Model = printer.Model.ToItem(),
StatusName = printer.Status.Name,
ConnetctionTypeName = printer.ConnetctionType.Name,
InstalledCartridgeId = printer.InstalledCartridge?.Id,
LocationName = printer.Location.Name,
};
public static Shared.Models.Printer.PrinterModelItem ToItem(this Entities.PrinterModel model) => new()
{
Name = model.Name,
Manufacturer = model.Manufacturer.ToItem(),
};
}
}