36 lines
956 B
C#
36 lines
956 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using OI.Metrology.Shared.Models.Stateless;
|
|
|
|
namespace OI.Metrology.Server.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.CopyFile(from, to);
|
|
return Results.Ok();
|
|
}
|
|
|
|
[HttpGet("file-write")]
|
|
public IResult FileWrite(string path, string contents)
|
|
{
|
|
_FileShareRepository.FileWrite(path, contents);
|
|
return Results.Ok();
|
|
}
|
|
|
|
} |