|
|
@ -39,7 +39,7 @@ public class NetworkConfigCopier : INetworkConfigCopier |
|
|
|
// 复制 RAG 配置文件
|
|
|
|
if (!string.IsNullOrEmpty(networkConfig.RagConfig)) |
|
|
|
{ |
|
|
|
if (!CopyConfigFile(networkConfig.RagConfig, appSettings.RanConfigDirectory, |
|
|
|
if (!CopyConfigFile(networkConfig.RagConfig, appSettings.TempDirectory,appSettings.RanConfigDirectory, |
|
|
|
path => networkConfig.RagConfig = path, "RAG")) |
|
|
|
{ |
|
|
|
return NetworkConfigCopyResult.Failure("复制RAG配置文件失败"); |
|
|
@ -51,7 +51,7 @@ public class NetworkConfigCopier : INetworkConfigCopier |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(config.CoreNetworkConfig)) |
|
|
|
{ |
|
|
|
if (!CopyConfigFile(config.CoreNetworkConfig, appSettings.MmeConfigDirectory, |
|
|
|
if (!CopyConfigFile(config.CoreNetworkConfig,appSettings.TempDirectory, appSettings.MmeConfigDirectory, |
|
|
|
path => config.CoreNetworkConfig = path, "核心网络")) |
|
|
|
{ |
|
|
|
return NetworkConfigCopyResult.Failure("复制CN配置文件失败"); |
|
|
@ -60,7 +60,7 @@ public class NetworkConfigCopier : INetworkConfigCopier |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(config.ImsConfig)) |
|
|
|
{ |
|
|
|
if (!CopyConfigFile(config.ImsConfig, appSettings.MmeConfigDirectory, |
|
|
|
if (!CopyConfigFile(config.ImsConfig, appSettings.TempDirectory, appSettings.MmeConfigDirectory, |
|
|
|
path => config.ImsConfig = path, "IMS")) |
|
|
|
{ |
|
|
|
return NetworkConfigCopyResult.Failure("复制IMS配置文件失败"); |
|
|
@ -170,7 +170,7 @@ public class NetworkConfigCopier : INetworkConfigCopier |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private bool CopyConfigFile(string sourcePath, string targetDirectory, Action<string> updatePath, string configType) |
|
|
|
private bool CopyConfigFile(string sourcePath,string tempDirectory, string targetDirectory, Action<string> updatePath, string configType) |
|
|
|
{ |
|
|
|
if (!File.Exists(sourcePath)) |
|
|
|
{ |
|
|
@ -179,7 +179,7 @@ public class NetworkConfigCopier : INetworkConfigCopier |
|
|
|
} |
|
|
|
|
|
|
|
var fileName = Path.GetFileName(sourcePath); |
|
|
|
var tempPath = Path.Combine(targetDirectory, fileName); |
|
|
|
var tempPath = Path.Combine(tempDirectory, fileName); |
|
|
|
|
|
|
|
// 始终复制到临时目录
|
|
|
|
File.Copy(sourcePath, tempPath, true); |
|
|
|