2023-01-24 20:20:32 +08:00
|
|
|
|
using Yi.Framework.Core.Helper;
|
|
|
|
|
|
using Yi.Framework.Template;
|
2023-01-21 18:09:21 +08:00
|
|
|
|
using Yi.Framework.Template.Provider.Server;
|
|
|
|
|
|
using Yi.Framework.Template.Provider.Site;
|
|
|
|
|
|
|
|
|
|
|
|
TemplateFactory templateFactory = new();
|
|
|
|
|
|
|
|
|
|
|
|
//选择需要生成的模板提供者
|
|
|
|
|
|
|
2023-01-25 17:48:48 +08:00
|
|
|
|
//string modelName = "GlobalSetting";
|
|
|
|
|
|
//string nameSpaces = "Yi.BBS";
|
|
|
|
|
|
//List<string> entityNames = new() { "Setting" };
|
|
|
|
|
|
|
|
|
|
|
|
//string modelName = "Exhibition";
|
|
|
|
|
|
//string nameSpaces = "Yi.BBS";
|
|
|
|
|
|
//List<string> entityNames = new() { "Banner" };
|
2023-01-29 21:13:20 +08:00
|
|
|
|
//string modelName = "Forum";
|
|
|
|
|
|
//string nameSpaces = "Yi.BBS";
|
|
|
|
|
|
//List<string> entityNames = new() { "_" };
|
2023-01-21 18:09:21 +08:00
|
|
|
|
|
2023-01-25 17:48:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-29 21:13:20 +08:00
|
|
|
|
//foreach (var entityName in entityNames)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// templateFactory.CreateTemplateProviders((option) =>
|
|
|
|
|
|
// {
|
|
|
|
|
|
// option.Add(new ServiceTemplateProvider(modelName, entityName, nameSpaces));
|
|
|
|
|
|
// option.Add(new IServiceTemplateProvider(modelName, entityName, nameSpaces));
|
2023-01-21 18:09:21 +08:00
|
|
|
|
|
2023-01-29 21:13:20 +08:00
|
|
|
|
// option.Add(new CreateInputVoTemplateProvider(modelName, entityName, nameSpaces));
|
|
|
|
|
|
// option.Add(new UpdateInputVoTemplateProvider(modelName, entityName, nameSpaces));
|
|
|
|
|
|
// option.Add(new GetListInputVoTemplateProvider(modelName, entityName, nameSpaces));
|
|
|
|
|
|
// option.Add(new GetListOutputDtoTemplateProvider(modelName, entityName, nameSpaces));
|
|
|
|
|
|
// option.Add(new GetOutputDtoTemplateProvider(modelName, entityName, nameSpaces));
|
2023-01-21 18:09:21 +08:00
|
|
|
|
|
2023-01-29 21:13:20 +08:00
|
|
|
|
// option.Add(new ConstTemplateProvider(modelName, entityName, nameSpaces));
|
|
|
|
|
|
// option.Add(new ProfileTemplateProvider(modelName, entityName, nameSpaces));
|
|
|
|
|
|
// //option.Add(new ApiTemplateProvider(modelName, entityName));
|
|
|
|
|
|
// });
|
|
|
|
|
|
// //开始构建模板
|
|
|
|
|
|
// templateFactory.BuildTemplate();
|
|
|
|
|
|
// Console.WriteLine($"Yi.Framework.Template:{entityName}构建完成!");
|
|
|
|
|
|
//}
|
2023-01-21 18:09:21 +08:00
|
|
|
|
|
2023-01-29 21:13:20 +08:00
|
|
|
|
//Console.WriteLine("Yi.Framework.Template:模板全部生成完成!");
|
|
|
|
|
|
//Console.ReadKey();
|
2023-01-24 20:20:32 +08:00
|
|
|
|
|
|
|
|
|
|
//根据模板文件生成项目文件
|
2023-01-29 21:13:20 +08:00
|
|
|
|
var template = "D:\\C#\\Yi\\Yi.Framework.Net6\\src\\project\\rbac";
|
|
|
|
|
|
FileHelper.AllInfoReplace(template, "Template", "RBAC");
|