Files
.Data
.vscode
Archive
Server
.vscode
ApiControllers
AppSettingsController.cs
AttachmentsController.cs
AwaitingDispoController.cs
ClientSettingsController.cs
ExportController.cs
FileShareController.cs
InboundController.cs
InfinityQSController.cs
InfinityQSV2Controller.cs
InfinityQSV3Controller.cs
InfinityQSV4Controller.cs
OpenInsightV1Controller.cs
PinController.cs
ServiceShopOrderController.cs
SpreadingResistanceProfileController.cs
ToolTypesController.cs
Controllers
Data
Models
Properties
Repositories
Services
Views
wwwroot
ApiLoggingMiddleware.cs
OI.Metrology.Server.csproj
Program.cs
compilerconfig.json
compilerconfig.json.defaults
Shared
Static
Tests
View
Wafer-Counter
.editorconfig
.gitignore
OI-Metrology.sln
README.md
azure-pipelines-server-development.yml
azure-pipelines-server.yml
package.json
oi-metrology/Server/ApiControllers/PinController.cs
2023-02-24 20:34:23 -07:00

33 lines
1.1 KiB
C#

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(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 });
}