平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IFileService.cs 1.6 KiB

4 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. 
  2. //
  3. namespace SafeCampus.System;
  4. /// <summary>
  5. /// 文件管理服务
  6. /// </summary>
  7. public interface IFileService : ITransient
  8. {
  9. /// <summary>
  10. /// 删除文件
  11. /// </summary>
  12. /// <param name="input">ID列表</param>
  13. /// <returns></returns>
  14. Task Delete(BaseIdListInput input);
  15. /// <summary>
  16. /// 文件下载
  17. /// </summary>
  18. /// <param name="input">文件iD</param>
  19. /// <returns>文件流</returns>
  20. Task<FileStreamResult> Download(BaseIdInput input);
  21. /// <summary>
  22. /// 获取FileStreamResult文件流
  23. /// </summary>
  24. /// <param name="path">路径</param>
  25. /// <param name="fileName">文件名</param>
  26. /// <param name="isPathFolder">路径是否是文件夹</param>
  27. /// <returns></returns>
  28. FileStreamResult GetFileStreamResult(string path, string fileName, bool isPathFolder = false);
  29. /// <summary>
  30. /// 获取FileStreamResult文件流
  31. /// </summary>
  32. /// <param name="byteArray">文件数组</param>
  33. /// <param name="fileName">文件名</param>
  34. /// <returns></returns>
  35. FileStreamResult GetFileStreamResult(byte[] byteArray, string fileName);
  36. /// <summary>
  37. /// 文件分页查询
  38. /// </summary>
  39. /// <param name="input">查询参数</param>
  40. /// <returns>文件列表</returns>
  41. Task<SqlSugarPagedList<SysFile>> Page(FilePageInput input);
  42. /// <summary>
  43. /// 上传文件到本地返回下载url
  44. /// </summary>
  45. /// <param name="engine">文件引擎</param>
  46. /// <param name="file">文件</param>
  47. /// <returns></returns>
  48. Task<long> UploadFile(string engine, IFormFile file);
  49. }