一 文件MinIO操作工具类
- package pro.tjkj.docaudiovisualres.util.minio;
-
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.stereotype.Component;
- import org.springframework.web.multipart.MultipartFile;
- import pro.tjkj.docaudiovisualres.util.DateUtil;
-
- import javax.annotation.Resource;
- import java.io.InputStream;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
-
- /**
- * 文件MinIO操作工具类
- */
- @Component
- public class FileUtils {
-
- private final Logger logger = LoggerFactory.getLogger(this.getClass());
-
- @Resource
- private MinioUtils minioUtils;
-
- @Resource
- private DateUtil dateUtil;
-
- public Map
uploadFile(MultipartFile inputStreamFile, String bucketName) { - String originalFilename = inputStreamFile.getOriginalFilename();//原文件名称
- String[] names = originalFilename.split("\\.");
- //处理文件名,避免重复
- String time = dateUtil.getDate