配置表接入和升级服务器框架到最新版
This commit is contained in:
@@ -635,12 +635,6 @@ public sealed class ExcelExporter
|
||||
var colInfos = isServer ? table.ServerColInfos : table.ClientColInfos;
|
||||
var exportPath = isServer ? App.Config.ServerPath : App.Config.ClientPath;
|
||||
|
||||
var csNamespace = isServer ? App.Config.ServerNamespace : App.Config.ClientNamespace;
|
||||
if (string.IsNullOrEmpty(csNamespace))
|
||||
{
|
||||
csNamespace = "NB";
|
||||
}
|
||||
|
||||
if (colInfos.Count <= 0)
|
||||
{
|
||||
return;
|
||||
@@ -720,7 +714,7 @@ public sealed class ExcelExporter
|
||||
}
|
||||
}
|
||||
|
||||
var template = ExcelTemplate.Template;
|
||||
var template = GetTemplate(isServer);
|
||||
|
||||
if (fileBuilder.Length > 0)
|
||||
{
|
||||
@@ -729,8 +723,7 @@ public sealed class ExcelExporter
|
||||
FileHelper.CreateDirectory(exportPath);
|
||||
}
|
||||
|
||||
var content = template.Replace("(namespace)", csNamespace)
|
||||
.Replace("(ConfigName)", csName)
|
||||
var content = template.Replace("(ConfigName)", csName)
|
||||
.Replace("(Fields)", fileBuilder.ToString());
|
||||
File.WriteAllText(Path.Combine(exportPath, $"{csName}.cs"), content);
|
||||
}
|
||||
@@ -748,4 +741,10 @@ public sealed class ExcelExporter
|
||||
|
||||
return index >= 0;
|
||||
}
|
||||
|
||||
private string GetTemplate(bool isServer)
|
||||
{
|
||||
var fileName = isServer ? "TemplateServer.txt" : "TemplateClient.txt";
|
||||
return File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user