diff --git a/1fichier.SDK.Test/ClientTest.cs b/1fichier.SDK.Test/ClientTest.cs index 9f62470..04c25eb 100644 --- a/1fichier.SDK.Test/ClientTest.cs +++ b/1fichier.SDK.Test/ClientTest.cs @@ -49,19 +49,19 @@ public void MethodClean() [TestMethod] public async Task UploadFilesTest() { - var root = await _client.ListFloder(0, true); + var root = await _client.ListFolder(0, true); if (root.sub_folders != null) { foreach (var i in root.sub_folders) { if (i.name == "test") { - await _client.RemoveFloder(i.id, true); + await _client.RemoveFolder(i.id, true); } } } - int targetDir = await _client.MakeFloder("test"); + int targetDir = await _client.MakeFolder("test"); Dictionary files2Upload = new Dictionary(); DirectoryInfo di = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory); @@ -90,7 +90,7 @@ public async Task UploadFilesTest() } Thread.Sleep(20 * 1000);//一个文件夹被上传文件后数秒内不能被删除。 - await _client.RemoveFloder(targetDir, true); + await _client.RemoveFolder(targetDir, true); } } } diff --git a/1fichier.SDK/1fichier.SDK.csproj b/1fichier.SDK/1fichier.SDK.csproj index 3c24648..18490fc 100644 --- a/1fichier.SDK/1fichier.SDK.csproj +++ b/1fichier.SDK/1fichier.SDK.csproj @@ -4,7 +4,7 @@ netstandard2.0 _1fichier.SDK true - 0.1.0 + 0.1.1 sanjusss true @@ -15,7 +15,7 @@ 0.1.0.0 GPL-3.0-only Dotnet SDK for 1fichier.com. - 增加上传文件和列文件夹的功能。 + 修复folder拼写错误。 diff --git a/1fichier.SDK/Client.cs b/1fichier.SDK/Client.cs index b320cf2..38f630a 100644 --- a/1fichier.SDK/Client.cs +++ b/1fichier.SDK/Client.cs @@ -305,25 +305,25 @@ public async Task> UploadFiles(Dictionary /// 列出文件夹。 /// - /// 文件夹ID + /// 文件夹ID /// 是否列出当前目录下的文件 /// 文件夹信息。 /// 非法的API Key。 /// 服务器返回的错误。 - public async Task ListFloder(int floder, bool listFiles = false) + public async Task ListFolder(int folder, bool listFiles = false) { await WaitToOperation(); using (var http = GetHttpClient(true)) { var request = new { - folder_id = floder, + folder_id = folder, files = listFiles ? 1 : 0 }; var response = await http.PostAsync("https://api.1fichier.com/v1/folder/ls.cgi", GetJsonContent(request)); string json = await response.Content.ReadAsStringAsync(); CheckResponse(json); - return JsonConvert.DeserializeObject(json); + return JsonConvert.DeserializeObject(json); } } @@ -336,7 +336,7 @@ public async Task ListFloder(int floder, bool listFiles = false) /// 新文件夹ID /// 非法的API Key。 /// 服务器返回的错误。 - public async Task MakeFloder(string name, int parent = 0, string sharingUser = null) + public async Task MakeFolder(string name, int parent = 0, string sharingUser = null) { await WaitToOperation(); using (var http = GetHttpClient(true)) @@ -358,20 +358,20 @@ public async Task MakeFloder(string name, int parent = 0, string sharingUse /// /// 删除指定文件夹。 /// - /// 目标文件夹ID + /// 目标文件夹ID /// 递归删除子文件夹和子文件,将耗费更多时间。 /// 非法的API Key。 /// 服务器返回的错误。 - public async Task RemoveFloder(int floder, bool recursively = false) + public async Task RemoveFolder(int folder, bool recursively = false) { if (recursively) { - var info = await ListFloder(floder, true); + var info = await ListFolder(folder, true); if (info.sub_folders != null) { foreach (var i in info.sub_folders) { - await RemoveFloder(i.id, true); + await RemoveFolder(i.id, true); } } @@ -395,7 +395,7 @@ public async Task RemoveFloder(int floder, bool recursively = false) { var request = new { - folder_id = floder + folder_id = folder }; var response = await http.PostAsync("https://api.1fichier.com/v1/folder/rm.cgi", GetJsonContent(request)); string json = await response.Content.ReadAsStringAsync(); diff --git a/1fichier.SDK/Result/FloderFileInfo.cs b/1fichier.SDK/Result/FolderFileInfo.cs similarity index 97% rename from 1fichier.SDK/Result/FloderFileInfo.cs rename to 1fichier.SDK/Result/FolderFileInfo.cs index b35152b..f8b4bd6 100644 --- a/1fichier.SDK/Result/FloderFileInfo.cs +++ b/1fichier.SDK/Result/FolderFileInfo.cs @@ -10,7 +10,7 @@ namespace _1fichier.SDK.Result /// /// 文件夹下的文件信息 /// - public struct FloderFileInfo + public struct FolderFileInfo { /// /// 文件是否处于保护模式(限制IP、国家、用户或使用者)。 diff --git a/1fichier.SDK/Result/FloderInfo.cs b/1fichier.SDK/Result/FolderInfo.cs similarity index 91% rename from 1fichier.SDK/Result/FloderInfo.cs rename to 1fichier.SDK/Result/FolderInfo.cs index f1f98ac..068f2c1 100644 --- a/1fichier.SDK/Result/FloderInfo.cs +++ b/1fichier.SDK/Result/FolderInfo.cs @@ -9,7 +9,7 @@ namespace _1fichier.SDK.Result /// /// 文件夹信息 /// - public struct FloderInfo + public struct FolderInfo { /// /// 文件夹状态 @@ -44,7 +44,7 @@ public struct FloderInfo /// /// 子文件夹的集合 /// - public IEnumerable sub_folders; + public IEnumerable sub_folders; /// /// 当前目录下的文件数量 /// @@ -52,6 +52,6 @@ public struct FloderInfo /// /// 当前目录下的文件的集合 /// - public IEnumerable items; + public IEnumerable items; } } diff --git a/1fichier.SDK/Result/SubFloderInfo.cs b/1fichier.SDK/Result/SubFolderInfo.cs similarity index 95% rename from 1fichier.SDK/Result/SubFloderInfo.cs rename to 1fichier.SDK/Result/SubFolderInfo.cs index c1b727f..fab37c0 100644 --- a/1fichier.SDK/Result/SubFloderInfo.cs +++ b/1fichier.SDK/Result/SubFolderInfo.cs @@ -9,7 +9,7 @@ namespace _1fichier.SDK.Result /// /// 子文件夹信息 /// - public struct SubFloderInfo + public struct SubFolderInfo { /// /// 文件夹ID diff --git a/appveyor.yml b/appveyor.yml index e41c6e1..bc1c381 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@  -version: 0.1.0.{build} +version: 0.1.1.{build} image: Visual Studio 2017 clone_depth: 1 environment: