Browse Source

update provider

Zixuan 8 hours ago
parent
commit
1e5ffbdba4
1 changed files with 11 additions and 2 deletions
  1. 11 2
      Server/EEMSClientCore/ClientProvider.cs

+ 11 - 2
Server/EEMSClientCore/ClientProvider.cs

@@ -16,7 +16,7 @@ public class ClientProvider(IClientCaller clientCaller, IClientBaseProvider base
         {
             if (current != 1)
                 return Task.FromResult(false);
-
+            baseProvider?.StartFileReceiveNotify(fileType);
             stream = new();
             _streamBuffer[fileType] = stream;
             Timer timer = new(FileCleanerTimerCallback, fileType, 600000, Timeout.Infinite);
@@ -27,7 +27,15 @@ public class ClientProvider(IClientCaller clientCaller, IClientBaseProvider base
         if (current != total)
             return Task.FromResult(true);
 
-        string path = Path.Combine(Environment.CurrentDirectory, "Receive");
+        string? tempPath = fileType switch
+        {
+            FileType.Recipe => baseProvider.RecipePath,
+            FileType.Config => baseProvider.ConfigPath,
+            _ => "Undefined"
+        };
+        tempPath ??= "Undefined";
+
+        string path = Path.Combine(tempPath, "Receive");
         if (!Compressor.DecompressZipFile(new(path), stream))
             return Task.FromResult(false);
 
@@ -97,4 +105,5 @@ public interface IClientBaseProvider
     string? ConfigPath { get; set; }
 
     void FileReceivedNotify(FileType fileType);
+    void StartFileReceiveNotify(FileType fileType);
 }