IFileStorage.cs 516 B

123456789101112131415
  1. using Microsoft.AspNetCore.Http;
  2. namespace SharedKernel.Storage;
  3. public interface IFileStorage
  4. {
  5. // 물리 파일 저장
  6. Task<FileUploadResult?> SaveFileAsync(IFormFile? file, FileStoragePath path, string[] allowedExtensions, CancellationToken ct = default);
  7. // 에디터 첨부 파일 저장
  8. Task<FileUploadResult?> SaveBytesAsync(ReadOnlyMemory<byte> bytes, string extension, FileStoragePath path, CancellationToken ct = default);
  9. // 이미지 삭제
  10. void DeleteByUrl(string? url);
  11. }