OSS 稽查修改 ,新增健康检查

IRC_NewDev
hang 2023-11-24 11:19:41 +08:00
parent da746c0e66
commit c4f0b0d60d
4 changed files with 42 additions and 2 deletions

View File

@ -563,7 +563,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

@ -71,6 +71,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");
@ -167,6 +169,8 @@ namespace IRaCIS.Core.API
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public async void Configure(IApplicationBuilder app, IWebHostEnvironment env) public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{ {
//±¾µØ»¯ //±¾µØ»¯
app.UseLocalization(); app.UseLocalization();
@ -234,6 +238,8 @@ namespace IRaCIS.Core.API
endpoints.MapControllers(); endpoints.MapControllers();
endpoints.MapHub<UploadHub>("/UploadHub"); endpoints.MapHub<UploadHub>("/UploadHub");
endpoints.MapHealthChecks("/health");
}); });
var hangfireJobService = app.ApplicationServices.GetRequiredService<IIRaCISHangfireJob>(); var hangfireJobService = app.ApplicationServices.GetRequiredService<IIRaCISHangfireJob>();

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);

View File

@ -85,6 +85,25 @@
<param name="type"></param> <param name="type"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSS(System.IO.Stream,System.String,System.String)">
<summary>
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
</summary>
<param name="fileStream"></param>
<param name="oosFolderPath"></param>
<param name="fileRealName"></param>
<returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
</member>
<member name="M:IRaCIS.Core.Application.Helper.OSSService.UploadToOSS(System.String,System.String)">
<summary>
oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
</summary>
<param name="localFilePath"></param>
<param name="oosFolderPath"></param>
<returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
</member>
<member name="T:IRaCIS.Core.Application.Service.TaskAllocationRuleService"> <member name="T:IRaCIS.Core.Application.Service.TaskAllocationRuleService">
<summary> <summary>
分配规则 分配规则