lichunlei 4 месяцев назад
Родитель
Сommit
c192f0193c
2 измененных файлов с 6 добавлено и 6 удалено
  1. 5 1
      Task/MakeHelper.cs
  2. 1 5
      Util/Maker.cs

+ 5 - 1
Task/MakeHelper.cs

@@ -33,12 +33,16 @@ namespace Tasks
         {
             try
             {
-                Utils.WriteLog(DateTime.Now.ToString() + "\n" + content, "生成接收");
+                // Utils.WriteLog(DateTime.Now.ToString() + "\n" + content, "生成接收");
                 JsonData jsonObj = JsonMapper.ToObject(content);
                 //流水号
                 string requestId = jsonObj["requestId"].ToString();
                 //模板文件路径
                 string modePath = jsonObj["modePath"].ToString();
+                if(modePath.Contains("controller"))
+                {
+                    string packageName = "123123123";
+                }
                 //附加数据,原样返回
                 string attach = jsonObj["attach"].ToString();
                 //读取模板文件内容

+ 1 - 5
Util/Maker.cs

@@ -228,7 +228,7 @@ namespace Util
                     condition = condition.Replace(".start(", ".StartsWith(");
                     condition = condition.Replace("True", "true");
                     condition = condition.Replace("False", "false");
-                    Console.WriteLine(condition);
+                    // Console.WriteLine(condition);
                     bool result = await CSharpScript.EvaluateAsync<bool>(condition);
                     content = content.Replace(matchValue, result ? resultValue : elseValue);
                 }
@@ -240,10 +240,6 @@ namespace Util
         #region 读取模版数据,替换对应的标签内容
         public static string replaceKeyToValue(JsonData jsonObj, string templateString)
         {
-            if(templateString.Contains("<<ym.projectService.packageName>>"))
-            {
-                string packageName = "123123123";
-            }
             MatchCollection mc = Regex.Matches(templateString, "<<.*?>>");
             foreach (Match m in mc)
             {