修改
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
he 2025-11-14 11:41:36 +08:00
parent 1dd8515ac2
commit b6bad061b7
3 changed files with 12 additions and 3 deletions

View File

@ -143,7 +143,7 @@ public enum ObjectStoreUse
public interface IOSSService public interface IOSSService
{ {
public Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true); public Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName, bool isFileNameAddGuid = true);
public Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true); public Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true, bool randomFileName = false);
public Task DownLoadFromOSSAsync(string ossRelativePath, string localFilePath); public Task DownLoadFromOSSAsync(string ossRelativePath, string localFilePath);
@ -322,9 +322,10 @@ public class OSSService : IOSSService
/// <param name="localFilePath"></param> /// <param name="localFilePath"></param>
/// <param name="oosFolderPath"></param> /// <param name="oosFolderPath"></param>
/// <param name="isFileNameAddGuid"></param> /// <param name="isFileNameAddGuid"></param>
/// <param name="randomFileName">随机文件名</param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception> /// <exception cref="BusinessValidationFailedException"></exception>
public async Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true) public async Task<string> UploadToOSSAsync(string localFilePath, string oosFolderPath, bool isFileNameAddGuid = true, bool randomFileName = false)
{ {
BackBatchGetToken(); BackBatchGetToken();
@ -332,6 +333,11 @@ public class OSSService : IOSSService
var ossRelativePath = isFileNameAddGuid ? $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}" : $"{oosFolderPath}/{localFileName}"; var ossRelativePath = isFileNameAddGuid ? $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}" : $"{oosFolderPath}/{localFileName}";
if (randomFileName)
{
var fileExtension = localFileName.Split(".").LastOrDefault();
ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}.{fileExtension}";
}
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS") if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
{ {

View File

@ -262,6 +262,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
result.VisitTaskNameList = data.VisitTaskList.Select(x => x.BlindName).ToList(); result.VisitTaskNameList = data.VisitTaskList.Select(x => x.BlindName).ToList();
if (inDto.QuestionId != null) if (inDto.QuestionId != null)
{ {
var question = data.TaskQuestions.SelectMany(x => x.Childrens) var question = data.TaskQuestions.SelectMany(x => x.Childrens)

View File

@ -340,7 +340,7 @@ namespace IRaCIS.Core.Application
foreach (var item in systemCriterionKeyFile) foreach (var item in systemCriterionKeyFile)
{ {
var path= await oSSService.UploadToOSSAsync(item.FilePath, $"{trialCriterion.TrialId}/KeyFile", true); var path= await oSSService.UploadToOSSAsync(item.FilePath, $"{trialCriterion.TrialId}/KeyFile", true,true);
trialCriterionKeyFiles.Add(new TrialCriterionKeyFile trialCriterionKeyFiles.Add(new TrialCriterionKeyFile
{ {