Class StorageController

java.lang.Object
org.liuxp.minioplus.extension.controller.StorageController
All Implemented Interfaces:
StorageWebAPI

@Controller @RequestMapping("/storage") public class StorageController extends Object implements StorageWebAPI
对象存储标准接口定义 本类的方法是给前端使用的方法
Since:
2024/6/18
Author:
contact@liuxp.me
  • Constructor Details

    • StorageController

      public StorageController(org.liuxp.minioplus.api.StorageService storageService)
  • Method Details

    • sharding

      public Response<org.liuxp.minioplus.api.model.vo.FilePreShardingVo> sharding(@RequestBody @Validated PreShardingDTO preShardingDTO)
      文件预分片方法 在大文件上传时,为了防止前端重复计算文件MD5值,提供该方法
      Specified by:
      sharding in interface StorageWebAPI
      Parameters:
      preShardingDTO - 文件预分片入参DTO
      Returns:
      预分片结果
    • init

      public Response<org.liuxp.minioplus.api.model.vo.FileCheckResultVo> init(FileCheckDTO fileCheckDTO)
      上传任务初始化 上传前的预检查:秒传、分块上传和断点续传等特性均基于该方法实现
      Specified by:
      init in interface StorageWebAPI
      Parameters:
      fileCheckDTO - 文件预检查入参
      Returns:
      检查结果
    • complete

      public Response<Object> complete(String fileKey, FileCompleteDTO fileCompleteDTO)
      文件上传完成
      Specified by:
      complete in interface StorageWebAPI
      Parameters:
      fileKey - 文件KEY
      fileCompleteDTO - 文件完成入参DTO
      Returns:
      是否成功
    • download

      public String download(String fileKey)
      文件下载
      Specified by:
      download in interface StorageWebAPI
      Parameters:
      fileKey - 文件KEY
      Returns:
      文件下载地址
    • previewOriginal

      public String previewOriginal(String fileKey)
      获取图像
      Specified by:
      previewOriginal in interface StorageWebAPI
      Parameters:
      fileKey - 文件KEY
      Returns:
      原图地址
    • previewMedium

      public String previewMedium(String fileKey)
      文件预览 当文件为图片时,返回图片的缩略图 当文件不是图片时,返回文件类型图标
      Specified by:
      previewMedium in interface StorageWebAPI
      Parameters:
      fileKey - 文件KEY
      Returns:
      缩略图地址
    • icon

      public void icon(String fileType)
      根据文件类型取得图标
      Specified by:
      icon in interface StorageWebAPI
      Parameters:
      fileType - 文件扩展名