zs
2025-04-30 84daa62f7ef6df79419dd01451cd21bb6bc7e091
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace GenerateCode_GEBrilliantFactory
{
    /// <summary>
    /// 生成Controller类
    /// </summary>
    public class Controller_Generate : BaseGenerate
    {
        public static string CreateText(string Modulelogo,
            string ChinaComment, List<ColumnModel> columnNameList, string entityName, string orderByName = "")
        {
            var str = TextHelper.ReadText(@"Templete\Controller模板.txt");
            CommonReplace(ref str);
            str = str.Replace("$ChinaComment$", ChinaComment);//中文注释
            str = str.Replace("$EntityName$", entityName);
            str = str.Replace("$Modulelogo$", Modulelogo);//模块简写
            str = str.Replace("$OrderByName$", orderByName == "" ? "Id" : orderByName);//模块简写
 
            str = str.Replace("$ValidateEmptyForInsert$", StructStrHelper.GetValidateEmptyStrForController(columnNameList));
            str = str.Replace("$ValidateEmptyForUpdate$", StructStrHelper.GetValidateEmptyStrForController(columnNameList, false));
 
 
 
            var pageStr = StructStrHelper.GetPageFilterStrForController(columnNameList);
            str = str.Replace("$PageSearchFilter$", pageStr);
 
            return str;
        }
    }
}