using JNPF.Common.Configuration;
namespace JNPF.VisualDev.Engine.Security;
///
/// 代码生成目标路径帮助类.
///
public class CodeGenTargetPathHelper
{
#region 前端相关文件
///
/// 前端页面生成文件路径.
///
/// 主表名称.
/// 压缩包名称.
/// 页面类型(1、纯表单,2、表单加列表).
/// 是否开启流程(0-否,1-是).
/// 是否有详情.
/// 高级查询.
///
public static List FrontEndTargetPathList(string tableName, string fileName, int webType, int enableFlow, bool isDetail = false, bool hasSuperQuery = false)
{
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "PC", tableName, "index.vue");
var formPath = Path.Combine(frontendPath, "html", "PC", tableName, "Form.vue");
var detailPath = Path.Combine(frontendPath, "html", "PC", tableName, "Detail.vue");
var exportJsonPath = Path.Combine(frontendPath, "fff", "flowForm.fff");
var columnJsonPath = Path.Combine(frontendPath, "html", "PC", tableName, "columnList.js");
var superQueryJsonPath = Path.Combine(frontendPath, "html", "PC", tableName, "superQueryJson.js");
var pathList = new List();
switch (webType)
{
case 1:
pathList.Add(indexPath);
pathList.Add(formPath);
if (enableFlow == 1)
pathList.Add(exportJsonPath);
break;
case 2:
pathList.Add(indexPath);
pathList.Add(formPath);
switch (enableFlow)
{
case 0:
if (isDetail)
pathList.Add(detailPath);
break;
case 1:
pathList.Add(exportJsonPath);
break;
}
pathList.Add(columnJsonPath);
if (hasSuperQuery)
pathList.Add(superQueryJsonPath);
break;
}
return pathList;
}
///
/// 前端页面模板文件路径集合.
///
/// 页面类型(1、纯表单,2、表单加列表,3、表单列表工作流).
/// 是否开启流程(0-否,1-是).
/// 是否有详情.
/// 高级查询.
/// 返回前端模板地址列表.
public static List FrontEndTemplatePathList(int webType, int enableFlow, bool isDetail = false, bool hasSuperQuery = false)
{
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
var pathList = new List();
switch (webType)
{
case 1:
switch (enableFlow)
{
case 1:
pathList.Add(Path.Combine(templatePath, "PureForm", "index.vue.vm"));
pathList.Add(Path.Combine(templatePath, "WorkflowForm.vue.vm"));
pathList.Add(Path.Combine(templatePath, "ExportJson.json.vm"));
break;
default:
pathList.Add(Path.Combine(templatePath, "Form.vue.vm"));
break;
}
break;
case 2:
switch (enableFlow)
{
case 1:
pathList.Add(Path.Combine(templatePath, "WorkflowIndex.vue.vm"));
pathList.Add(Path.Combine(templatePath, "WorkflowForm.vue.vm"));
pathList.Add(Path.Combine(templatePath, "ExportJson.json.vm"));
break;
default:
pathList.Add(Path.Combine(templatePath, "index.vue.vm"));
pathList.Add(Path.Combine(templatePath, "Form.vue.vm"));
if (isDetail)
pathList.Add(Path.Combine(templatePath, "Detail.vue.vm"));
break;
}
pathList.Add(Path.Combine(templatePath, "columnList.js.vm"));
if (hasSuperQuery)
pathList.Add(Path.Combine(templatePath, "superQueryJson.js.vm"));
break;
}
return pathList;
}
///
/// 前端行内编辑页面生成文件路径.
///
/// 主表名称.
/// 压缩包名称.
/// 是否开启流程.
/// 是否有详情.
/// 高级查询.
///
public static List FrontEndInlineEditorTargetPathList(string tableName, string fileName, int enableFlow, bool isDetail = false, bool hasSuperQuery = false)
{
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "PC", tableName, "index.vue");
var extraForm = Path.Combine(frontendPath, "html", "PC", tableName, "extraForm.vue");
var detailPath = Path.Combine(frontendPath, "html", "PC", tableName, "Detail.vue");
var formPath = Path.Combine(frontendPath, "html", "PC", tableName, "Form.vue");
var exportJsonPath = Path.Combine(frontendPath, "fff", "flowForm.fff");
var columnJsonPath = Path.Combine(frontendPath, "html", "PC", tableName, "columnList.js");
var superQueryJsonPath = Path.Combine(frontendPath, "html", "PC", tableName, "superQueryJson.js");
var pathList = new List();
pathList.Add(indexPath);
switch (enableFlow)
{
case 0:
pathList.Add(extraForm);
if (isDetail)
pathList.Add(detailPath);
break;
default:
if (isDetail)
pathList.Add(formPath);
pathList.Add(exportJsonPath);
break;
}
pathList.Add(columnJsonPath);
if (hasSuperQuery)
pathList.Add(superQueryJsonPath);
return pathList;
}
///
/// 前端行内编辑页面模板文件路径集合.
///
/// 是否开启流程.
/// 是否有详情.
/// 高级查询.
/// 返回前端模板地址列表.
public static List FrontEndInlineEditorTemplatePathList(int enableFlow, bool isDetail = false, bool hasSuperQuery = false)
{
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
var pathList = new List();
switch (enableFlow)
{
case 0:
pathList.Add(Path.Combine(templatePath, "editorIndex.vue.vm"));
pathList.Add(Path.Combine(templatePath, "extraForm.vue.vm"));
if (isDetail)
pathList.Add(Path.Combine(templatePath, "Detail.vue.vm"));
break;
case 1:
pathList.Add(Path.Combine(templatePath, "editorWorkflowIndex.vue.vm"));
if (isDetail)
pathList.Add(Path.Combine(templatePath, "WorkflowForm.vue.vm"));
pathList.Add(Path.Combine(templatePath, "ExportJson.json.vm"));
break;
}
pathList.Add(Path.Combine(templatePath, "columnList.js.vm"));
if (hasSuperQuery)
pathList.Add(Path.Combine(templatePath, "superQueryJson.js.vm"));
return pathList;
}
///
/// App前端带流程页面模板文件路径集合.
///
/// 页面类型(1、纯表单,2、表单加列表).
///
public static List AppFrontEndWorkflowTemplatePathList(int webType)
{
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
var pathList = new List();
switch (webType)
{
case 1:
pathList.Add(Path.Combine(templatePath, "PureForm", "appWorkflowIndex.vue.vm"));
pathList.Add(Path.Combine(templatePath, "appWorkflowForm.vue.vm"));
break;
case 2:
pathList.Add(Path.Combine(templatePath, "appWorkflowIndex.vue.vm"));
pathList.Add(Path.Combine(templatePath, "appWorkflowForm.vue.vm"));
pathList.Add(Path.Combine(templatePath, "columnList.js.vm"));
break;
}
return pathList;
}
///
/// 设置App前端带流程页面生成文件路径.
///
/// 主表名称.
/// 压缩包名称.
/// 页面类型(1、纯表单,2、表单加列表).
/// 是否开启详情.
///
public static List AppFrontEndWorkflowTargetPathList(string tableName, string fileName, int webType)
{
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "App", "index", tableName, "index.vue");
var formPath = Path.Combine(frontendPath, "html", "App", "form", tableName, "index.vue");
var columnJsonPath = Path.Combine(frontendPath, "html", "App", "index", tableName, "columnList.js");
var pathList = new List();
switch (webType)
{
case 1:
pathList.Add(indexPath);
pathList.Add(formPath);
break;
case 2:
pathList.Add(indexPath);
pathList.Add(formPath);
pathList.Add(columnJsonPath);
break;
}
return pathList;
}
///
/// App前端页面模板文件路径集合.
///
/// 页面类型(1、纯表单,2、表单加列表,3、表单列表工作流).
/// 是否开启详情.
///
public static List AppFrontEndTemplatePathList(int webType, bool isDetail)
{
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
var pathList = new List();
switch (webType)
{
case 1:
pathList.Add(Path.Combine(templatePath, "appForm.vue.vm"));
break;
case 2:
pathList.Add(Path.Combine(templatePath, "appIndex.vue.vm"));
pathList.Add(Path.Combine(templatePath, "appForm.vue.vm"));
if (isDetail)
pathList.Add(Path.Combine(templatePath, "appDetail.vue.vm"));
pathList.Add(Path.Combine(templatePath, "columnList.js.vm"));
break;
}
return pathList;
}
///
/// 设置App前端页面生成文件路径.
///
/// 主表名称.
/// 压缩包名称.
/// 页面类型(1、纯表单,2、表单加列表).
/// 是否开启详情.
///
public static List AppFrontEndTargetPathList(string tableName, string fileName, int webType, bool isDetail)
{
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "App", tableName, "index.vue");
var formPath = Path.Combine(frontendPath, "html", "App", tableName, "form.vue");
var detailPath = Path.Combine(frontendPath, "html", "App", tableName, "detail.vue");
var columnJsonPath = Path.Combine(frontendPath, "html", "App", tableName, "columnList.js");
var pathList = new List();
switch (webType)
{
case 1:
pathList.Add(indexPath);
break;
case 2:
pathList.Add(indexPath);
pathList.Add(formPath);
if (isDetail)
pathList.Add(detailPath);
pathList.Add(columnJsonPath);
break;
}
return pathList;
}
///
/// 流程前端页面模板文件路径集合.
///
/// 逻辑类型4-pc,5-app.
///
public static List FlowFrontEndTemplatePathList(int logicType)
{
var pathList = new List();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (logicType)
{
case 4:
pathList.Add(Path.Combine(templatePath, "WorkflowForm.vue.vm"));
break;
case 5:
pathList.Add(Path.Combine(templatePath, "appWorkflowForm.vue.vm"));
break;
}
pathList.Add(Path.Combine(templatePath, "ExportJson.json.vm"));
return pathList;
}
///
/// 流程前端页面生成文件路径.
///
/// 逻辑类型4-pc,5-app.
/// 主表名称.
/// 压缩包名称.
///
public static List FlowFrontEndTargetPathList(int logicType, string tableName, string fileName)
{
var pathList = new List();
var frontendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var indexPath = Path.Combine(frontendPath, "html", "PC", tableName, "index.vue");
var indexAppPath = Path.Combine(frontendPath, "html", "APP", tableName, "index.vue");
var exportJsonPath = Path.Combine(frontendPath, "fff", "flowForm.fff");
switch (logicType)
{
case 4:
pathList.Add(indexPath);
break;
case 5:
pathList.Add(indexAppPath);
break;
}
pathList.Add(exportJsonPath);
return pathList;
}
#endregion
#region 单主表相关文件
///
/// 后端模板文件路径集合.
///
/// SingleTable-单主表,MainBelt-主带子,,,.
/// 生成模板类型(1、纯表单,2、表单加列表,3、表单列表工作流).
/// 是否开启工作流.
/// 是否对象映射.
///
public static List BackendTemplatePathList(string genModel, int webType, int enableFlow, bool isMapper)
{
List templatePathList = new List();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (webType)
{
case 1:
templatePathList.Add(Path.Combine(templatePath, genModel, "Service.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "IService.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
switch (enableFlow)
{
case 1:
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
break;
}
break;
case 2:
templatePathList.Add(Path.Combine(templatePath, genModel, "Service.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "IService.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
switch (enableFlow)
{
case 0:
templatePathList.Add(Path.Combine(templatePath, "UpInput.cs.vm"));
break;
}
templatePathList.Add(Path.Combine(templatePath, genModel, "ListQueryInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "ListOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "DetailOutput.cs.vm"));
break;
}
return templatePathList;
}
///
/// 后端主表生成文件路径.
///
/// 表名.
/// 文件价名称.
/// 页面类型(1、纯表单,2、表单加列表).
/// 是否开启工作流.
/// 是否行内编辑.
/// 是否对象映射.
///
public static List BackendTargetPathList(string tableName, string fileName, int webType, int enableFlow, bool isInlineEditor, bool isMapper)
{
List targetPathList = new List();
var backendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var servicePath = Path.Combine(backendPath, "Controller", tableName, tableName + "Service.cs");
var iservicePath = Path.Combine(backendPath, "Controller", tableName, "I" + tableName + "Service.cs");
var entityPath = Path.Combine(backendPath, "Models", "Entity", tableName, tableName + "Entity.cs");
var mapperPath = Path.Combine(backendPath, "Models", "Mapper", tableName, tableName + "Mapper.cs");
var inputCrPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "CrInput.cs");
var inputUpPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "UpInput.cs");
var inputListQueryPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "ListQueryInput.cs");
var outputInfoPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "InfoOutput.cs");
var outputListPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "ListOutput.cs");
var outputDetailPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "DetailOutput.cs");
var inlineEditorListPath = Path.Combine(backendPath, "Models", "Dto", tableName, tableName + "InlineEditorOutput.cs");
switch (webType)
{
case 1:
targetPathList.Add(servicePath);
targetPathList.Add(iservicePath);
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
switch (enableFlow)
{
case 1:
targetPathList.Add(outputInfoPath);
break;
}
break;
case 2:
targetPathList.Add(servicePath);
targetPathList.Add(iservicePath);
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
switch (enableFlow)
{
case 0:
targetPathList.Add(inputUpPath);
break;
}
targetPathList.Add(inputListQueryPath);
targetPathList.Add(outputInfoPath);
targetPathList.Add(outputListPath);
if (isInlineEditor)
targetPathList.Add(inlineEditorListPath);
targetPathList.Add(outputDetailPath);
break;
}
return targetPathList;
}
///
/// 后端行内编辑模板文件路径集合.
///
/// SingleTable-单主表,MainBelt-主带子,,,.
/// 生成模板类型(1、纯表单,2、表单加列表,3、表单列表工作流).
/// 是否开启工作流.
/// 是否对象映射.
///
public static List BackendInlineEditorTemplatePathList(string genModel, int webType, int enableFlow, bool isMapper)
{
List templatePathList = new List();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (webType)
{
case 2:
templatePathList.Add(Path.Combine(templatePath, genModel, "InlineEditor", "Service.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "IService.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
switch (enableFlow)
{
case 0:
templatePathList.Add(Path.Combine(templatePath, "UpInput.cs.vm"));
break;
}
templatePathList.Add(Path.Combine(templatePath, genModel, "ListQueryInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InlineEditor", "ListOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InlineEditor", "InlineEditorOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "DetailOutput.cs.vm"));
break;
}
return templatePathList;
}
#endregion
#region 后端子表
///
/// 后端模板文件路径集合.
///
/// SingleTable-单主表,MainBelt-主带子,,,.
/// 生成模板类型(1、纯表单,2、表单加列表).
/// 模板类型.
/// 是否对象映射.
/// 是否展示子表字段.
///
public static List BackendChildTableTemplatePathList(string genModel, int webType, int type, bool isMapper, bool isShowSubTableField)
{
List templatePathList = new List();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (webType)
{
case 1:
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
if (type == 3)
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
break;
case 2:
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "UpInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
if (isShowSubTableField)
templatePathList.Add(Path.Combine(templatePath, genModel, "ListOutput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "DetailOutput.cs.vm"));
break;
}
return templatePathList;
}
///
/// 后端主表生成文件路径.
///
/// 表名.
/// 文件价名称.
/// 页面类型(1、纯表单,2、表单加列表).
/// 模板类型.
/// 是否对象映射.
/// 是否展示子表字段.
///
public static List BackendChildTableTargetPathList(string tableName, string fileName, int webType, int type, bool isMapper, bool isShowSubTableField)
{
List targetPathList = new List();
var backendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var entityPath = Path.Combine(backendPath, "Models", "Entity", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "Entity.cs");
var mapperPath = Path.Combine(backendPath, "Models", "Mapper", tableName, tableName + "Mapper.cs");
var inputCrPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "CrInput.cs");
var inputUpPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "UpInput.cs");
var outputInfoPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "InfoOutput.cs");
var outputListPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "ListOutput.cs");
var inputListQueryPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "ListQueryInput.cs");
var outputDetailPath = Path.Combine(backendPath, "Models", "Dto", (type == 3 ? "WorkFlowForm\\" : string.Empty) + tableName, tableName + "DetailOutput.cs");
switch (webType)
{
case 1:
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
if (type == 3)
targetPathList.Add(outputInfoPath);
break;
case 2:
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
targetPathList.Add(inputUpPath);
targetPathList.Add(outputInfoPath);
if (isShowSubTableField)
targetPathList.Add(outputListPath);
targetPathList.Add(outputDetailPath);
break;
}
return targetPathList;
}
#endregion
#region 后端副表
///
/// 后端副表生成文件路径.
///
/// 表名.
/// 文件价名称.
/// 生成模板类型(1、纯表单,2、表单加列表).
/// 模板类型.
/// 是否开启流程.
///
public static List BackendAuxiliaryTargetPathList(string tableName, string fileName, int webType, int type, int enableFlow)
{
List targetPathList = new List();
var backendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var entityPath = Path.Combine(backendPath, "Models", "Entity", type == 3 ? "WorkFlowForm\\" + tableName : tableName, tableName + "Entity.cs");
var mapperPath = Path.Combine(backendPath, "Models", "Mapper", tableName, tableName + "Mapper.cs");
var inputCrPath = Path.Combine(backendPath, "Models", "Dto", type == 3 ? "WorkFlowForm\\" + tableName : tableName, tableName + "CrInput.cs");
var outputInfoPath = Path.Combine(backendPath, "Models", "Dto", type == 3 ? "WorkFlowForm\\" + tableName : tableName, tableName + "InfoOutput.cs");
switch (webType)
{
case 1:
targetPathList.Add(entityPath);
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
if (enableFlow == 1 || type == 3)
targetPathList.Add(outputInfoPath);
break;
default:
targetPathList.Add(entityPath);
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
targetPathList.Add(outputInfoPath);
break;
}
return targetPathList;
}
///
/// 后端副表模板文件路径集合.
///
/// SingleTable-单主表,MainBelt-主带子,,,.
/// 生成模板类型(1、纯表单,2、表单加列表).
/// 是否开启流程.
///
public static List BackendAuxiliaryTemplatePathList(string genModel, int webType, int type, int enableFlow)
{
List templatePathList = new List();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
switch (webType)
{
case 1:
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
if (enableFlow == 1 || type == 3)
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
break;
default:
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
break;
}
return templatePathList;
}
#endregion
#region 后端流程
///
/// 后端流程模板文件路径集合.
///
/// SingleTable-单主表,MainBelt-主带子,,,.
/// 是否对象映射.
///
public static List BackendFlowTemplatePathList(string genModel, bool isMapper)
{
List templatePathList = new List();
var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
templatePathList.Add(Path.Combine(templatePath, genModel, "Service.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, "IService.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "Entity.cs.vm"));
if (isMapper)
templatePathList.Add(Path.Combine(templatePath, genModel, "Mapper.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "CrInput.cs.vm"));
templatePathList.Add(Path.Combine(templatePath, genModel, "InfoOutput.cs.vm"));
return templatePathList;
}
///
/// 后端主表生成文件路径.
///
/// 表名.
/// 文件价名称.
/// 是否对象映射.
///
public static List BackendFlowTargetPathList(string tableName, string fileName, bool isMapper)
{
List targetPathList = new List();
var backendPath = Path.Combine(KeyVariable.SystemPath, "CodeGenerate", fileName, "Net");
var servicePath = Path.Combine(backendPath, "Controller", tableName, tableName + "Service.cs");
var iservicePath = Path.Combine(backendPath, "Controller", tableName, "I" + tableName + "Service.cs");
var entityPath = Path.Combine(backendPath, "Models", "Entity", "WorkFlowForm", tableName + "Entity.cs");
var mapperPath = Path.Combine(backendPath, "Models", "Mapper", tableName, tableName + "Mapper.cs");
var inputCrPath = Path.Combine(backendPath, "Models", "Dto", "WorkFlowForm", tableName, tableName + "CrInput.cs");
var outputInfoPath = Path.Combine(backendPath, "Models", "Dto", "WorkFlowForm", tableName, tableName + "InfoOutput.cs");
targetPathList.Add(servicePath);
targetPathList.Add(iservicePath);
targetPathList.Add(entityPath);
if (isMapper)
targetPathList.Add(mapperPath);
targetPathList.Add(inputCrPath);
targetPathList.Add(outputInfoPath);
return targetPathList;
}
#endregion
}