222
schangxiang@126.com
2025-05-04 90776aadd4531fa054c8679d240edfaba91e005f
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace GenerateCode_GEBrilliantFactory
{
    /// <summary>
    /// 生成新增参数实体类
    /// </summary>
    public class AddModel_Generate : BaseGenerate
    {
        public static string CreateAddModelLText(string addEntityParam,
            string ChinaComment, List<ColumnModel> columnNameList)
        {
            //var str = TextHelper.ReadText(@"Templete\Entity\AddModel模板.txt");
            var str = TextHelper.ReadText(@"Templete\Entity\InputModel模板.txt");
            CommonReplace(ref str);
            str = str.Replace("$ChinaComment$", ChinaComment);//中文注释
 
            str = str.Replace("$AddEntityParam$", addEntityParam);
 
            string attrString = "";
 
            List<ColumnModel> newColumnNameList = ListHelper.RemoveIdCreatorModifier(columnNameList);
            for (int i = 0; i < newColumnNameList.Count; ++i)
            {
                attrString += StructStrHelper.GenerateAttributeForAddModel(newColumnNameList[i]);
            }
            str = str.Replace("$AddAttributes$", attrString);
 
            return str;
        }
    }
}