zs
2025-05-05 25750ab29ce4e243f4e4e17a796167f3a0f0697b
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Generate/Controller/Controller_Generate.cs
@@ -1,5 +1,6 @@

using GenerateCode_WeiBen_WMS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -12,24 +13,16 @@
    /// </summary>
    public class Controller_Generate : BaseGenerate
    {
        public static string CreateText(string Modulelogo,
            string ChinaComment, List<ColumnModel> columnNameList, string entityName, string orderByName = "")
        public static string CreateText(GenerateCodeParam param)
        {
            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));
            CommonReplace(ref str);
            CommonHelper.CommonReplaceStr(param, ref str);
            var pageStr = StructStrHelper.GetPageFilterStrForController(columnNameList);
            str = str.Replace("$PageSearchFilter$", pageStr);
            return str;
        }
    }