mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 12:30:55 +00:00
Добавил выпадающие списки в диалоговом окне добавления принтера
This commit is contained in:
1 parent
88f53c793e
commit
b492435289
8 files changed
+106
-5
No files matched your search
@@ -53,6 +53,16 @@ namespace CartriX.Api.Controllers
|
||||
return Ok($"Принтер с названием хоста \"{requestDto.hostname}\" был добавлен.");
|
||||
}
|
||||
|
||||
[HttpGet("Models")]
|
||||
public async Task<IActionResult> GetAllModels()
|
||||
{
|
||||
var list = await _printerService.GetAllPrinterModel();
|
||||
|
||||
var convert = list.Select(m => m.ToDto());
|
||||
|
||||
return Ok(convert);
|
||||
}
|
||||
|
||||
[HttpGet("GetSNMP/{ipAddressOrHostname}")]
|
||||
public async Task<IActionResult> GetPrinterListParametersFromSNMPAsync([FromRoute] string ipAddressOrHostname)
|
||||
{
|
||||
|
||||
@@ -9,5 +9,6 @@ namespace CartriX.Api.Interfaces
|
||||
public Task<Printer?> GetById(int id);
|
||||
public Task<Printer> AddAsync(CreatePrinterRequestDto requestDto);
|
||||
public Task<QueryPrinterToAdd?> GetPrinterListParametersFromSNMPAsync(string ipAddressOrHostname);
|
||||
public Task<List<PrinterModel>> GetAllPrinterModel();
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,6 @@ namespace CartriX.Api.Services
|
||||
.Include(m => m.model).ToListAsync();
|
||||
return queryResult;
|
||||
}
|
||||
|
||||
public async Task<Printer?> GetById(int id)
|
||||
{
|
||||
Console.WriteLine("Запрос в базу данных.");
|
||||
@@ -44,6 +43,8 @@ namespace CartriX.Api.Services
|
||||
|
||||
return queryResult;
|
||||
}
|
||||
public async Task<List<PrinterModel>> GetAllPrinterModel() => await _context.PrinterModels.ToListAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user