lichunlei 4 месяцев назад
Родитель
Сommit
ef1f411c5c
3 измененных файлов с 14 добавлено и 6 удалено
  1. 1 1
      Controllers/Base/HomeController.cs
  2. 3 2
      Task/MakeHelper.cs
  3. 10 3
      Util/OssHelper.cs

+ 1 - 1
Controllers/Base/HomeController.cs

@@ -22,7 +22,7 @@ namespace Controllers
         [Route("/noauth/pub/test")]
         public bool test()
         {
-            bool result = Utils.EvaluateBoolean("'2025-02-01'>'2025-01-01'");
+            bool result = Utils.EvaluateBoolean("in(2,[1,2,3,4,5,6])");
             return result;
         }
     }

+ 3 - 2
Task/MakeHelper.cs

@@ -45,9 +45,10 @@ namespace Tasks
                 //     string packageName = "123123123";
                 // }
                 //附加数据,原样返回
-                JsonData attach = jsonObj["attach"];
+                JsonData attach = JsonMapper.ToObject(jsonObj["attach"].ToString());
                 string versionNo = attach["versionNo"].ToString();
                 string fileType = attach["fileType"].ToString();
+                string userId = attach["userId"].ToString();
                 //读取模板文件内容
                 // string templateString = Function.ReadInstance("Template/" + modePath + ".json");
                 var templateService = App.GetRequiredService<IMakeTemplateService>();
@@ -69,7 +70,7 @@ namespace Tasks
                 Function.WritePage(path, fileName, resultString);
                 string startPath = Function.getPath(path + fileName);
                 OssHelper.Instance.Upload(startPath);
-                addFile(projectId, serviceId, 0, versionNo, fileName, path + fileName, path + fileName, fileType, javaVersion, "java");
+                addFile(projectId, serviceId, int.Parse(Function.CheckInt(userId)), versionNo, fileName, path + fileName, path + fileName, fileType, javaVersion, "java");
                 //生成数据入库
                 int dataId = int.Parse(Function.CheckInt(attach["dataId"].ToString()));
                 string makeFileType = attach["fileType"].ToString();

+ 10 - 3
Util/OssHelper.cs

@@ -41,8 +41,15 @@ namespace Util
             var client = new OssClient(OssHelper.Instance.endpoint, OssHelper.Instance.key, OssHelper.Instance.secret);
             if(dataFilePath.Substring(dataFilePath.LastIndexOf("/")).Contains("."))
             {
-                string localFile = dataFilePath.Substring(dataFilePath.IndexOf("Code/")).Replace("\\", "/");
-                ScanQueue(localFile, dataFilePath, client);
+                if(dataFilePath.Contains("net7.0/"))
+                {
+                    string localFile = dataFilePath.Substring(dataFilePath.IndexOf("net7.0//") + 8).Replace("\\", "/");
+                    ScanQueue(localFile, dataFilePath, client);
+                }
+                else
+                {
+                    ScanQueue(dataFilePath, dataFilePath, client);
+                }
             }
             else
             {
@@ -63,7 +70,7 @@ namespace Util
                 //是文件
                 if (file != null)
                 {
-                    string localFile = file.FullName.Substring(file.FullName.IndexOf("Code/")).Replace("\\", "/");
+                    string localFile = file.FullName.Substring(file.FullName.IndexOf("net7.0//") + 8).Replace("\\", "/");
                     ScanQueue(localFile, file.FullName, client);
                 }
                 else scan(files[i], client);