Обновил модель базы данных

Слегка изменил сущности
Добавил страницу в Web
Сделал компонент с карточками для принетров
This commit is contained in:
Hukuta committed 2026-05-31 03:10:04 +09:00
1 parent 9cc166e37d
commit 24adf91ad9
16 files changed
+788 -21

No files matched your search

@@ -41,5 +41,6 @@ namespace CartriX.Api.Controllers.Printer
var cartridge = await _printerService.GetPrinterAsync(Id);
return (cartridge is not null) ? StatusCode(200, cartridge.ToItem()) : StatusCode(404, $"Принтер с идентификатором \"{Id}\" не найден.");
}
}
}
@@ -24,12 +24,10 @@ namespace CartriX.Api.Controllers.Cartridge
};
public static Shared.Models.Printer.PrinterItemList ToItemList(this Entities.Printer printer) => new()
{
Id = printer.Id,
Name = printer.Name,
Model = printer.Model.ToItem(),
StatusId = printer.Status.Name,
ConnetctionTypeName = printer.ConnetctionType.Name,
InstalledCartridgeId = printer.InstalledCartridge.Id,
LocationName = printer.Location.Name,
StatusId = printer.StatusId
};
}
@@ -4,13 +4,8 @@ using Microsoft.EntityFrameworkCore;
namespace CartriX.Api.Controllers.Cartridge
{
public class PrinterService : IPrinterService
public class PrinterService(AppDbContext _context) : IPrinterService
{
private readonly AppDbContext _context;
public PrinterService(AppDbContext context)
{
_context = context;
}
/// <summary>
/// Добавление принетера в базу данных
/// </summary>
@@ -30,7 +25,7 @@ namespace CartriX.Api.Controllers.Cartridge
OidForQueryCountPrintedAllTime = printer.OidForQueryCountPrintedAllTime,
PrintTypeId = printer.PrintTypeId,
Model = Model,
PrinterStatusId = 1,
StatusId = 1,
PrinterConnetctionTypeId = printer.PrinterConnetctionTypeId,
InstalledCartridge = new() { Model = new() { Name = Article.Name, Manufacturer = Manufacturer, SupportedArticles = new() { Article } }, Volume = printer.VolumeBuiltInCartridge },
Location = Location