diff --git a/IRaCIS.Core.API/Properties/launchSettings.json b/IRaCIS.Core.API/Properties/launchSettings.json index aed031839..9016eb3ac 100644 --- a/IRaCIS.Core.API/Properties/launchSettings.json +++ b/IRaCIS.Core.API/Properties/launchSettings.json @@ -36,7 +36,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Staging" }, - "applicationUrl": "http://localhost:6200" + "applicationUrl": "http://localhost:6100" }, "IRaCIS.Production": { "commandName": "Project", diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 21772cf98..dcd24c696 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -179,6 +179,7 @@ namespace IRaCIS.Core.API //不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication. app.UseStaticFiles(); + app.UseMiddleware(); //LogDashboard app.UseLogDashboard("/LogDashboard"); @@ -186,8 +187,7 @@ namespace IRaCIS.Core.API //hangfire app.UseHangfireConfig(env); - ////暂时废弃 - //app.UseHttpReports(); + ////限流 中间件 //app.UseIpRateLimiting(); @@ -204,7 +204,6 @@ namespace IRaCIS.Core.API } Console.WriteLine("当前环境: " + env.EnvironmentName); - //app.UseMiddleware(); // 特殊异常处理 比如 404 app.UseStatusCodePagesWithReExecute("/Error/{0}"); @@ -221,15 +220,13 @@ namespace IRaCIS.Core.API app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); //app.UseIRacisHostStaticFileStore(env); - app.UseMiddleware(); + + app.UseAuthentication(); - //app.UseJwtBearerQueryString(); app.UseAuthorization(); - ////文件伺服 必须带Token 访问 - ////app.UseIRacisHostStaticFileStore(env); app.UseEndpoints(endpoints => { diff --git a/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs b/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs index d2ecc5990..3ac9b2bd1 100644 --- a/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs +++ b/IRaCIS.Core.API/_PipelineExtensions/IRacisHostFile/MultiDiskStaticFilesMiddleware.cs @@ -1,8 +1,11 @@ -锘縰sing IRaCIS.Core.Application.Helper; +锘縰sing Azure; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.StaticFiles; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.FileProviders.Physical; @@ -11,6 +14,7 @@ using Microsoft.Extensions.Hosting.Internal; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Microsoft.VisualBasic; +using Newtonsoft.Json; using SharpCompress.Common; using System.IO; using System.Linq; @@ -147,6 +151,12 @@ namespace IRaCIS.Core.API return; } } + + // 濡傛灉娌℃湁鎵惧埌鏂囦欢锛岃繑鍥404 + context.Response.StatusCode = 404; + context.Response.ContentType = "application/json"; + + await context.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk("File not found"))); } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs index 7a1912366..32032bdac 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs @@ -23,11 +23,15 @@ namespace IRaCIS.Core.Application.Services /// 鎸囧畾璧勬簮Id锛岃幏鍙朌icom搴忓垪鎵灞炵殑瀹炰緥淇℃伅鍒楄〃 /// Dicom搴忓垪鐨処d [HttpGet("{seriesId:guid}")] - public async Task> List(Guid seriesId) + public async Task>> List(Guid seriesId) { - return await _instanceRepository.Where(s => s.SeriesId == seriesId).OrderBy(s => s.InstanceNumber). + var list = await _instanceRepository.Where(s => s.SeriesId == seriesId).OrderBy(s => s.InstanceNumber). ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + var imageResizePath = await _instanceRepository.Where(s => s.SeriesId == seriesId).Select(t => t.DicomSerie.ImageResizePath).FirstOrDefaultAsync(); + + return ResponseOutput.Ok(list, new { ImageResizePath = imageResizePath }); } @@ -103,6 +107,6 @@ namespace IRaCIS.Core.Application.Services } } - + } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IInstanceService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IInstanceService.cs index 24a3f6307..792923e3a 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IInstanceService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IInstanceService.cs @@ -6,7 +6,7 @@ namespace IRaCIS.Core.Application.Services public interface IInstanceService { Task Content(Guid instanceId); - Task> List(Guid seriesId); + Task>> List(Guid seriesId); IEnumerable List(Guid seriesId, string tpCode, bool? key); Task Preview(Guid instanceId); } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index da06e0a23..a6bfa7786 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -710,6 +710,7 @@ namespace IRaCIS.Application.Services #region 璁胯浠诲姟 - Dicom 闃呯墖 琛ㄦ牸闂鐩稿叧鏌ヨ + /// /// 鑾峰彇DIcom闃呯墖闂绛旀 ///