瀏覽代碼

生成文件入库,保存下载路径

lichunlei 4 月之前
父節點
當前提交
a7325ae4f5
共有 3 個文件被更改,包括 4 次插入1 次删除
  1. 1 0
      Filters/AuthorizationFilter.cs
  2. 1 1
      Model/Dto/FileDto.cs
  3. 2 0
      Task/MakeHelper.cs

+ 1 - 0
Filters/AuthorizationFilter.cs

@@ -151,6 +151,7 @@ namespace Filters
                                             string val = Newtonsoft.Json.JsonConvert.SerializeObject(value).Replace("[", "").Replace("]", "").Trim('"');
                                             value = Tools.SpitLongArrary(val, ',').ToList();
                                         }
+                                        value ??= "";
                                         if(value.ToString() == "-1") value = -1;
                                         if(value.ToString() == "[]") value = "";
                                         queryString += "\"" + key + "\":\"" + value.ToString() + "\",";

+ 1 - 1
Model/Dto/FileDto.cs

@@ -16,7 +16,7 @@ namespace Dto
         public int fileId { get; set; }
 
         //文件内容
-        public string fileContent { get; set; } = "";
+        public string? fileContent { get; set; }
     }
 
     public class InitServerDto

+ 2 - 0
Task/MakeHelper.cs

@@ -158,6 +158,7 @@ namespace Tasks
                     language = language,
                 });
                 filePath.fileVersionNo = codeVersion;
+                makeFilesService.Update(filePath);
                 ParentFileId = filePath.fileId;
 
                 FilesForAll fileAllPath = filesForAllService.GetFirst(m => m.projectId == projectId && m.localPath == DirPath);
@@ -193,6 +194,7 @@ namespace Tasks
             });
             file.downloadPath = downloadPath;
             file.fileVersionNo = codeVersion;
+            makeFilesService.Update(file);
 
             FilesForAll fileAll = filesForAllService.GetFirst(m => m.projectId == projectId && m.localPath == localPath && m.fileName == fileName) ?? filesForAllService.InsertReturnEntity(new FilesForAll()
             {