ard-work/src/main/java/com/ruoyi/device/hiksdk/util/minio/MinioUtils.java
@@ -1,5 +1,6 @@
package com.ruoyi.device.hiksdk.util.minio;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.device.hiksdk.config.MinioClientSingleton;
import io.minio.*;
@@ -32,6 +33,10 @@
    public static boolean exitsBucket(String bucketName) {
        boolean found = false;
        try {
            if(StringUtils.isEmpty(bucketName))
            {
                return false;
            }
            BucketExistsArgs bucketExistsArgs = BucketExistsArgs.builder().bucket(bucketName).build();
            found = MinioClientSingleton.getMinioClient().bucketExists(bucketExistsArgs);
        } catch (Exception ex) {
@@ -45,6 +50,10 @@
     */
    public static boolean createBucket(String bucketName) {
        try {
            if(StringUtils.isEmpty(bucketName))
            {
                return false;
            }
            /*创建桶*/
            MakeBucketArgs makeBucketArgs = MakeBucketArgs.builder().bucket(bucketName).build();
            MinioClientSingleton.getMinioClient().makeBucket(makeBucketArgs);
@@ -133,6 +142,10 @@
                log.error("minio生成失效url异常", ex.getMessage());
            }
        }
        else
        {
            createBucket(bucketName);
        }
        return url;
    }
@@ -145,6 +158,10 @@
     * @修改人和其它信息
     */
    public static String putObjectAndGetUrl(String bucketName, MultipartFile file) {
         if(!exitsBucket(bucketName))
        {
            createBucket(bucketName);
        }
        //判断文件是否为空
        if (null == file || 0 == file.getSize()) {
            log.error("上传minio文件服务器错误,上传文件为空");
@@ -197,6 +214,10 @@
     * @修改人和其它信息
     */
    public static String putObjectAndGetUrl(String bucketName, String folder, MultipartFile file) {
        if(!exitsBucket(bucketName))
        {
            createBucket(bucketName);
        }
        //判断文件是否为空
        if (null == file || 0 == file.getSize()) {
            log.error("上传minio文件服务器错误,上传文件为空");
@@ -351,6 +372,10 @@
     */
    public static boolean uploadObject(String bucketName, String objectName, InputStream stream, long size, String contextType) {
        try {
            if(!exitsBucket(bucketName))
            {
                createBucket(bucketName);
            }
            PutObjectArgs putObjectArgs = PutObjectArgs.builder()
                    .bucket(bucketName)
                    .object(objectName)
@@ -375,6 +400,10 @@
     */
    public static boolean uploadObject(String bucketName, String objectName, File file, String contextType) {
        try {
            if(!exitsBucket(bucketName))
            {
                createBucket(bucketName);
            }
            FileInputStream fileInputStream = new FileInputStream(file);
            PutObjectArgs putObjectArgs = PutObjectArgs.builder()
                    .bucket(bucketName)
@@ -400,13 +429,9 @@
     */
    public static boolean uploadObject(String bucketName, String objectName, MultipartFile multipartFile, String contextType) {
        try {
            if (bucketName.isEmpty()) {
                log.error("bucket名称为空");
                return false;
            }
            if (objectName.isEmpty()) {
                log.error("对象名称为空");
                return false;
            if(!exitsBucket(bucketName))
            {
                createBucket(bucketName);
            }
            InputStream inputStream = multipartFile.getInputStream();
            PutObjectArgs putObjectArgs = PutObjectArgs.builder()
@@ -433,6 +458,10 @@
     */
    public static boolean uploadObject(String bucketName, MultipartFile multipartFile, String contextType) {
        try {
            if(!exitsBucket(bucketName))
            {
                createBucket(bucketName);
            }
            if (multipartFile == null) {
                log.error("上传文件为空");
                return false;
@@ -461,11 +490,11 @@
     * @param localFilePathName
     * @return
     */
    public static boolean uploadObject(String bulkName, String objectName, String localFilePathName, String contextType) {
    public static boolean uploadObject(String bucketName, String objectName, String localFilePathName, String contextType) {
        try {
            if (!exitsBucket(bulkName)) {
                log.debug(bulkName + "不存在");
                return false;
            if(!exitsBucket(bucketName))
            {
                createBucket(bucketName);
            }
            File file = new File(localFilePathName);
            if (!file.exists()) {
@@ -473,7 +502,7 @@
                return false;
            }
            UploadObjectArgs uploadObjectArgs = UploadObjectArgs.builder()
                    .bucket(bulkName)
                    .bucket(bucketName)
                    .object(objectName)
                    .filename(localFilePathName)
                    .contentType(contextType)