Viewer to Server
This commit is contained in:
33
Server/ApiControllers/PinController.cs
Normal file
33
Server/ApiControllers/PinController.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace OI.Metrology.Server.ApiControllers;
|
||||
|
||||
using OI.Metrology.Shared.Models.Stateless;
|
||||
using System.Text.Json;
|
||||
|
||||
[Route("api/[controller]")]
|
||||
public class PinController : Controller, IPinController<IActionResult>
|
||||
{
|
||||
|
||||
private readonly IPinRepository _PinRepository;
|
||||
private readonly IMetrologyRepository _MetrologyRepository;
|
||||
|
||||
public PinController(ILogger<InboundController> logger, IMetrologyRepository metrologyRepository, IPinRepository pinRepository)
|
||||
{
|
||||
_MetrologyRepository = metrologyRepository;
|
||||
_PinRepository = pinRepository;
|
||||
}
|
||||
|
||||
[HttpPost("{toolTypeId}/markAsPinned")]
|
||||
public IActionResult MarkAsPinned(Shared.DataModels.HeaderCommon headerCommon)
|
||||
{
|
||||
_PinRepository.SetPinnedTable(headerCommon);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("{toolTypeId}/pinned")]
|
||||
public IActionResult GetPinnedTable(int toolTypeId, string? biorad_id = null, string? cde_id = null, string? rds = null) =>
|
||||
Json(_PinRepository.GetPinnedTable(_MetrologyRepository, toolTypeId, biorad_id, cde_id, rds), new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
|
||||
|
||||
}
|
Reference in New Issue
Block a user