| | |
| | | package com.ruoyi.web.controller.common; |
| | | |
| | | import com.google.common.collect.Iterables; |
| | | import com.ruoyi.basic.service.StorageBlobService; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.Constants; |
| | |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.Getter; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private StorageBlobService storageBlobService; |
| | | |
| | | @Getter |
| | | @Value("${minio.default-bucket}") |
| | | private String defaultBucket; |
| | | |
| | | /** |
| | | * 通用下载请求 |
| | |
| | | log.error("下载文件失败", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据 storage_blob 表id 返回minio文件列表 |
| | | * @param ids |
| | | */ |
| | | @PostMapping("/findFileListByIds") |
| | | public R findFileListByIds(@RequestBody List<Long> ids){ |
| | | if (Iterables.isEmpty(ids)){ |
| | | return R.ok(); |
| | | } |
| | | return R.ok(storageBlobService.findStorageByIds(ids,defaultBucket)); |
| | | } |
| | | |
| | | } |