配置表接入和升级服务器框架到最新版

This commit is contained in:
2025-10-10 17:57:01 +08:00
parent 520d4f37bd
commit 8a302754d6
250 changed files with 6356 additions and 4135 deletions

View File

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