diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index fdab77e01..2d18a2d5a 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -800,7 +800,7 @@ namespace IRaCIS.Core.API.Controllers templateFileStream.Seek(0, SeekOrigin.Begin); - var ossRelativePath = oSSService.UploadToOSS(fileStream, "InspectionUpload/SiteSurvey", realFileName); + var ossRelativePath = oSSService.UploadToOSS(fileStream, "InspectionUpload/Check", realFileName); await _repository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId }); diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 4727ed475..f7ef89e47 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -75,6 +75,8 @@ namespace IRaCIS.Core.API // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + // + services.AddHealthChecks(); //ػ services.AddJsonLocalization(options => options.ResourcesPath = "Resources"); @@ -243,6 +245,8 @@ namespace IRaCIS.Core.API endpoints.MapControllers(); endpoints.MapHub("/UploadHub"); + + endpoints.MapHealthChecks("/health"); }); diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs index dab2bb588..c83ec5fc4 100644 --- a/IRaCIS.Core.Application/Helper/OSSService.cs +++ b/IRaCIS.Core.Application/Helper/OSSService.cs @@ -113,6 +113,14 @@ namespace IRaCIS.Core.Application.Helper } + /// + /// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder + /// + /// + /// + /// + /// + /// public string UploadToOSS(Stream fileStream, string oosFolderPath,string fileRealName) { @@ -133,7 +141,7 @@ namespace IRaCIS.Core.Application.Helper } - return ossRelativePath; + return "/" + ossRelativePath; } catch (Exception ex) { @@ -142,6 +150,13 @@ namespace IRaCIS.Core.Application.Helper } } + /// + /// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder + /// + /// + /// + /// + /// public string UploadToOSS(string localFilePath, string oosFolderPath) { var localFileName = Path.GetFileName(localFilePath);