From 07ad3fc126c05c93ce594542526ae97985db001c Mon Sep 17 00:00:00 2001 From: zggsong Date: Sun, 14 Jan 2024 14:44:14 +0800 Subject: [PATCH] chore: publish 1.0.2.114 and update async func name --- STranslate/STranslate.csproj | 4 ++-- STranslate/ViewModels/InputViewModel.cs | 6 +++--- STranslate/ViewModels/ServiceHandler.cs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/STranslate/STranslate.csproj b/STranslate/STranslate.csproj index c6d4fb54..7d512fe9 100644 --- a/STranslate/STranslate.csproj +++ b/STranslate/STranslate.csproj @@ -10,8 +10,8 @@ app.manifest x64 README.md - 1.0.1.0111 - 1.0.1.0111 + 1.0.2.0114 + 1.0.2.0114 diff --git a/STranslate/ViewModels/InputViewModel.cs b/STranslate/ViewModels/InputViewModel.cs index 298fd0b6..4a027064 100644 --- a/STranslate/ViewModels/InputViewModel.cs +++ b/STranslate/ViewModels/InputViewModel.cs @@ -181,9 +181,9 @@ await Parallel.ForEachAsync( //TODO: 新接口需要适配 service.Data = service.Type switch { - ServiceType.ApiService => await ServiceHandler.ApiHandler(service, InputContent, sourceStr, targetStr, token), - ServiceType.BaiduService => await ServiceHandler.BaiduHandler(service, InputContent, sourceStr, targetStr, token), - ServiceType.BingService => await ServiceHandler.BingHandler(service, InputContent, sourceStr, targetStr, token), + ServiceType.ApiService => await ServiceHandler.ApiHandlerAsync(service, InputContent, sourceStr, targetStr, token), + ServiceType.BaiduService => await ServiceHandler.BaiduHandlerAsync(service, InputContent, sourceStr, targetStr, token), + ServiceType.BingService => await ServiceHandler.BingHandlerAsync(service, InputContent, sourceStr, targetStr, token), _ => throw new NotImplementedException() }; } diff --git a/STranslate/ViewModels/ServiceHandler.cs b/STranslate/ViewModels/ServiceHandler.cs index bed14c79..e3fad575 100644 --- a/STranslate/ViewModels/ServiceHandler.cs +++ b/STranslate/ViewModels/ServiceHandler.cs @@ -22,7 +22,7 @@ public class ServiceHandler /// /// /// - public static async Task ApiHandler(ITranslator service, string content, string source, string target, CancellationToken token) + public static async Task ApiHandlerAsync(ITranslator service, string content, string source, string target, CancellationToken token) { var response = (Task) @@ -49,7 +49,7 @@ await service.TranslateAsync( /// /// /// - public static async Task BaiduHandler(ITranslator service, string content, string source, string target, CancellationToken token) + public static async Task BaiduHandlerAsync(ITranslator service, string content, string source, string target, CancellationToken token) { string salt = new Random().Next(100000).ToString(); string sign = StringUtil.EncryptString(service.AppID + content + salt + service.AppKey); @@ -84,7 +84,7 @@ await service.TranslateAsync( /// /// /// - public static async Task BingHandler(ITranslator service, string content, string source, string target, CancellationToken token) + public static async Task BingHandlerAsync(ITranslator service, string content, string source, string target, CancellationToken token) { var req = new RequestBing {