Merge branch 'Test_HIR_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_HIR_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
4350aa6459
|
|
@ -16,6 +16,7 @@ using Minio;
|
|||
using Minio.DataModel;
|
||||
using Minio.DataModel.Args;
|
||||
using Minio.Exceptions;
|
||||
using System.Net.Http;
|
||||
using System.Reactive.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Web;
|
||||
|
|
@ -226,8 +227,14 @@ public class OSSService : IOSSService
|
|||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
|
||||
var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
|
||||
};
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.WithHttpClient(new HttpClient(httpClientHandler))
|
||||
.Build();
|
||||
|
||||
var putObjectArgs = new PutObjectArgs()
|
||||
|
|
@ -347,9 +354,14 @@ public class OSSService : IOSSService
|
|||
{
|
||||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
|
||||
};
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.WithHttpClient(new HttpClient(httpClientHandler))
|
||||
.Build();
|
||||
|
||||
var putObjectArgs = new PutObjectArgs()
|
||||
|
|
@ -420,10 +432,18 @@ public class OSSService : IOSSService
|
|||
}
|
||||
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||
{
|
||||
var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
|
||||
};
|
||||
|
||||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
Console.WriteLine(minIOConfig.ToJsonStr() +$"ossRelativePath:{ossRelativePath} localFilePath:{localFilePath} ");
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.WithHttpClient(new HttpClient(httpClientHandler))
|
||||
.Build();
|
||||
|
||||
var getObjectArgs = new GetObjectArgs()
|
||||
|
|
@ -508,10 +528,17 @@ public class OSSService : IOSSService
|
|||
{
|
||||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
|
||||
var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
|
||||
};
|
||||
|
||||
var minioClient = new MinioClient()
|
||||
.WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey)
|
||||
.WithSSL(minIOConfig.UseSSL)
|
||||
.WithHttpClient(new HttpClient(httpClientHandler))
|
||||
.Build();
|
||||
|
||||
var memoryStream = new MemoryStream();
|
||||
|
|
@ -961,8 +988,14 @@ public class OSSService : IOSSService
|
|||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
|
||||
var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
|
||||
};
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.WithHttpClient(new HttpClient(httpClientHandler))
|
||||
.Build();
|
||||
|
||||
|
||||
|
|
@ -1070,8 +1103,15 @@ public class OSSService : IOSSService
|
|||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
|
||||
var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
|
||||
};
|
||||
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.WithHttpClient(new HttpClient(httpClientHandler))
|
||||
.Build();
|
||||
|
||||
|
||||
|
|
@ -1149,8 +1189,15 @@ public class OSSService : IOSSService
|
|||
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||
|
||||
|
||||
var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
|
||||
};
|
||||
|
||||
|
||||
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||
.WithHttpClient(new HttpClient(httpClientHandler))
|
||||
.Build();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -777,13 +777,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
string[] strArry = url.Split('/');
|
||||
savePath = savePath + "/" + strArry[strArry.Length - 1];
|
||||
}
|
||||
|
||||
Console.WriteLine($"savePath:{savePath}");
|
||||
|
||||
var directory = Path.GetDirectoryName(savePath);
|
||||
if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))
|
||||
{
|
||||
Console.WriteLine($"CreateDirectory:{directory}");
|
||||
Directory.CreateDirectory(directory);
|
||||
}
|
||||
|
||||
await _oSSService.DownLoadFromOSSAsync(url, savePath);
|
||||
|
||||
return savePath;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Log.Logger.Error(ex.Message + ex.StackTrace);
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingCalculate_ImageNotExist"]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue