修改OSS 上传通用配置 6

IRC_NewDev
hang 2024-01-11 16:32:35 +08:00
parent 7f90d64064
commit 172f6bc29f
4 changed files with 14 additions and 8 deletions

View File

@ -566,7 +566,7 @@ namespace IRaCIS.Core.API.Controllers
templateFileStream.Seek(0, SeekOrigin.Begin);
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/Check", $"{Guid.NewGuid()}_" + realFileName);
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/Check", realFileName);
await _repository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });
@ -997,7 +997,7 @@ namespace IRaCIS.Core.API.Controllers
throw new BusinessValidationFailedException(StaticData.International("UploadDownLoad_TemplateUploadData"));
}
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/SiteSurvey", $"{Guid.NewGuid()}_"+ realFileName);
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/SiteSurvey", realFileName);
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });

View File

@ -44,7 +44,6 @@
"secretKey": "l+yjtvV7Z4jiwm/7xCYv30UeUj/SvuqqYzAwjJHf",
"bucketName": "ei-irc-test-store",
"viewEndpoint": "https://ei-irc-test-store.s3.amazonaws.com/"
}
},

View File

@ -19,7 +19,7 @@ using SkiaSharp;
namespace IRaCIS.Core.Application.Helper
{
public class MinIOOptions: AWSOptions
public class MinIOOptions : AWSOptions
{
public int port { get; set; }
@ -125,7 +125,10 @@ namespace IRaCIS.Core.Application.Helper
/// <returns></returns>
public async Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName)
{
var ossRelativePath = oosFolderPath + "/" + fileRealName;
var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{fileRealName}";
//var ossRelativePath = oosFolderPath + "/" + fileRealName;
using (var memoryStream = new MemoryStream())
{
@ -204,7 +207,9 @@ namespace IRaCIS.Core.Application.Helper
{
var localFileName = Path.GetFileName(localFilePath);
var ossRelativePath = oosFolderPath + "/" + localFileName;
var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}";
//var ossRelativePath = oosFolderPath + "/" + localFileName;
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")

View File

@ -93,6 +93,8 @@ server:
user: root
password:
from_secret: test_ssh_pwd
# ssh_key:
# from_secret: rsa_key
steps:
- name: publish-test-irc