Merge branch 'Test.Study' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test.Study
continuous-integration/drone/push Build is passing Details

Uat_Study
hang 2023-11-24 11:25:17 +08:00
commit f0725873e1
3 changed files with 21 additions and 2 deletions

View File

@ -800,7 +800,7 @@ namespace IRaCIS.Core.API.Controllers
templateFileStream.Seek(0, SeekOrigin.Begin); 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 }); await _repository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });

View File

@ -75,6 +75,8 @@ namespace IRaCIS.Core.API
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
//½¡¿µ¼ì²é
services.AddHealthChecks();
//±¾µØ»¯ //±¾µØ»¯
services.AddJsonLocalization(options => options.ResourcesPath = "Resources"); services.AddJsonLocalization(options => options.ResourcesPath = "Resources");
@ -243,6 +245,8 @@ namespace IRaCIS.Core.API
endpoints.MapControllers(); endpoints.MapControllers();
endpoints.MapHub<UploadHub>("/UploadHub"); endpoints.MapHub<UploadHub>("/UploadHub");
endpoints.MapHealthChecks("/health");
}); });

View File

@ -113,6 +113,14 @@ namespace IRaCIS.Core.Application.Helper
} }
/// <summary>
/// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
/// </summary>
/// <param name="fileStream"></param>
/// <param name="oosFolderPath"></param>
/// <param name="fileRealName"></param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
public string UploadToOSS(Stream fileStream, string oosFolderPath,string fileRealName) 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) catch (Exception ex)
{ {
@ -142,6 +150,13 @@ namespace IRaCIS.Core.Application.Helper
} }
} }
/// <summary>
/// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
/// </summary>
/// <param name="localFilePath"></param>
/// <param name="oosFolderPath"></param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
public string UploadToOSS(string localFilePath, string oosFolderPath) public string UploadToOSS(string localFilePath, string oosFolderPath)
{ {
var localFileName = Path.GetFileName(localFilePath); var localFileName = Path.GetFileName(localFilePath);