Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
ceb1337cde
|
@ -49,7 +49,13 @@ namespace IRaCIS.Core.API
|
|||
|
||||
var isDicomFile = path.Contains($"{StaticData.Folder.DicomFolder}");
|
||||
|
||||
|
||||
|
||||
//先从默认里面去找
|
||||
if (isIRacisFile)
|
||||
{
|
||||
var defaultFileProvider = new PhysicalFileProvider(FileStoreHelper.GetIRaCISRootPath(_hostingEnv));
|
||||
|
||||
var staticFileOptions = new StaticFileOptions
|
||||
{
|
||||
FileProvider = defaultFileProvider,
|
||||
|
@ -58,11 +64,6 @@ namespace IRaCIS.Core.API
|
|||
DefaultContentType = "application/octet-stream"
|
||||
};
|
||||
|
||||
var defaultRoot = Path.GetPathRoot(iRaCISDefaultDataFolder);
|
||||
|
||||
//先从默认里面去找
|
||||
if (isIRacisFile)
|
||||
{
|
||||
if (defaultFileProvider.GetFileInfo(context.Request.Path).Exists)
|
||||
{
|
||||
|
||||
|
@ -78,7 +79,14 @@ namespace IRaCIS.Core.API
|
|||
//dicom影像,从多个文件夹尝试,因为会存在切换磁盘
|
||||
if (isDicomFile)
|
||||
{
|
||||
var disks = GetDisks().Where(t=>!t.Contains(defaultRoot));
|
||||
var defaultRoot = Path.GetPathRoot(iRaCISDefaultDataFolder);
|
||||
|
||||
//除默认部署路径的其他路径
|
||||
var disks = DriveInfo.GetDrives()
|
||||
.Where(d => d.IsReady && d.DriveType == DriveType.Fixed)/*.Where(t => !t.Name.Contains("C") && !t.Name.Contains("c"))*/
|
||||
.OrderBy(d => d.AvailableFreeSpace)
|
||||
.Select(d => d.RootDirectory.FullName)
|
||||
.ToArray().Where(t=>!t.Contains(defaultRoot));
|
||||
|
||||
|
||||
foreach (var item in disks)
|
||||
|
@ -92,13 +100,7 @@ namespace IRaCIS.Core.API
|
|||
|
||||
var otherFileProvider= new PhysicalFileProvider(otherFileStoreFolder);
|
||||
|
||||
var otherStaticFileOptions = new StaticFileOptions
|
||||
{
|
||||
FileProvider = otherFileProvider,
|
||||
RequestPath = $"/{StaticData.Folder.IRaCISDataFolder}",
|
||||
ServeUnknownFileTypes = true,
|
||||
DefaultContentType = "application/octet-stream"
|
||||
};
|
||||
|
||||
|
||||
if (otherFileProvider.GetFileInfo(context.Request.Path).Exists)
|
||||
{
|
||||
|
@ -108,9 +110,20 @@ namespace IRaCIS.Core.API
|
|||
//方式一
|
||||
await context.Response.SendFileAsync( new PhysicalFileInfo(new FileInfo(actrualPath)));
|
||||
|
||||
//方式二
|
||||
#region 方式二 报错 otherFileProvider 应该还包含/{StaticData.Folder.IRaCISDataFolder} 这一层级
|
||||
//var otherStaticFileOptions = new StaticFileOptions
|
||||
//{
|
||||
// FileProvider = otherFileProvider,
|
||||
// RequestPath = $"/{StaticData.Folder.IRaCISDataFolder}",
|
||||
// ServeUnknownFileTypes = true,
|
||||
// DefaultContentType = "application/octet-stream"
|
||||
//};
|
||||
//var staticFileMiddleware = new StaticFileMiddleware(_next, _hostingEnv, Options.Create(otherStaticFileOptions), _loggerFactory);
|
||||
//await staticFileMiddleware.Invoke(context);
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -123,14 +136,7 @@ namespace IRaCIS.Core.API
|
|||
|
||||
|
||||
|
||||
private string[] GetDisks()
|
||||
{
|
||||
// 获取系统中所有可用的磁盘
|
||||
return DriveInfo.GetDrives()
|
||||
.Where(d => d.IsReady && d.DriveType == DriveType.Fixed).Where(t => !t.Name.Contains("C") && !t.Name.Contains("c"))
|
||||
.Select(d => d.RootDirectory.FullName)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//private static string GetContentType(string path)
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
//存放在instance 上面
|
||||
public string WindowCenter { get; set; } = string.Empty;
|
||||
public string WindowWidth { get; set; } = string.Empty;
|
||||
|
||||
public string IamgeResizePath { get; set; }
|
||||
}
|
||||
|
||||
public class DicomSeriesWithLabelDTO : DicomSeriesDTO
|
||||
|
|
Loading…
Reference in New Issue