平安校园
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.
 
 
 
 
 
 

64 lines
1.6 KiB

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