AzureDevOpsRepository Markdown links Ticks bug fix, default to *.wc files and formatting
57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using OI.Metrology.Shared.DataModels;
|
|
using OI.Metrology.Shared.Models;
|
|
using OI.Metrology.Shared.Models.Stateless;
|
|
using OI.Metrology.Wafer.Counter.Helper;
|
|
using System.Collections.ObjectModel;
|
|
|
|
namespace OI.Metrology.Wafer.Counter.ApiControllers;
|
|
|
|
[Route("api/v1/file-share")]
|
|
public class FileShareController : Controller, IFileShareController<IResult>
|
|
{
|
|
|
|
private readonly IFileShareRepository _FileShareRepository;
|
|
|
|
public FileShareController(IFileShareRepository fileShareRepository) =>
|
|
_FileShareRepository = fileShareRepository;
|
|
|
|
[HttpGet("copy-file")]
|
|
public IResult CopyFile(string from, string to)
|
|
{
|
|
_FileShareRepository.CopyFile(from, to);
|
|
return Results.Ok();
|
|
}
|
|
|
|
[HttpGet("move-file")]
|
|
public IResult MoveFile(string from, string to)
|
|
{
|
|
_FileShareRepository.MoveFile(from, to);
|
|
return Results.Ok();
|
|
}
|
|
|
|
[HttpGet("file-write")]
|
|
public IResult FileWrite(string path, string contents)
|
|
{
|
|
_FileShareRepository.FileWrite(path, contents);
|
|
return Results.Ok();
|
|
}
|
|
|
|
[HttpGet("archive-data")]
|
|
public IActionResult ArchiveData()
|
|
{
|
|
ReadOnlyCollection<CharacterizationInfo> results;
|
|
CharacterizationParameters? characterizationParameters = ParameterHelper.GetCharacterizationParameters(Request.QueryString);
|
|
ArgumentNullException.ThrowIfNull(characterizationParameters);
|
|
results = _FileShareRepository.GetArchiveData(characterizationParameters);
|
|
return Json(results);
|
|
}
|
|
|
|
[HttpGet("equipment-ids")]
|
|
public IActionResult EquipmentIds()
|
|
{
|
|
ReadOnlyCollection<ToolTypeNameId> results = _FileShareRepository.GetEquipmentIds();
|
|
return Json(results);
|
|
}
|
|
|
|
} |