Skip to content

Commit

Permalink
chore: publish 1.0.2.114 and update async func name
Browse files Browse the repository at this point in the history
  • Loading branch information
ZGGSONG committed Jan 14, 2024
1 parent 3932b20 commit 07ad3fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions STranslate/STranslate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<PlatformTarget>x64</PlatformTarget>
<PackageReadmeFile>README.md</PackageReadmeFile>
<AssemblyVersion>1.0.1.0111</AssemblyVersion>
<FileVersion>1.0.1.0111</FileVersion>
<AssemblyVersion>1.0.2.0114</AssemblyVersion>
<FileVersion>1.0.2.0114</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
6 changes: 3 additions & 3 deletions STranslate/ViewModels/InputViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
}
Expand Down
6 changes: 3 additions & 3 deletions STranslate/ViewModels/ServiceHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ServiceHandler
/// <param name="target"></param>
/// <param name="token"></param>
/// <returns></returns>
public static async Task<string> ApiHandler(ITranslator service, string content, string source, string target, CancellationToken token)
public static async Task<string> ApiHandlerAsync(ITranslator service, string content, string source, string target, CancellationToken token)
{
var response =
(Task<object>)
Expand All @@ -49,7 +49,7 @@ await service.TranslateAsync(
/// <param name="target"></param>
/// <param name="token"></param>
/// <returns></returns>
public static async Task<string> BaiduHandler(ITranslator service, string content, string source, string target, CancellationToken token)
public static async Task<string> 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);
Expand Down Expand Up @@ -84,7 +84,7 @@ await service.TranslateAsync(
/// <param name="target"></param>
/// <param name="token"></param>
/// <returns></returns>
public static async Task<string> BingHandler(ITranslator service, string content, string source, string target, CancellationToken token)
public static async Task<string> BingHandlerAsync(ITranslator service, string content, string source, string target, CancellationToken token)
{
var req = new RequestBing
{
Expand Down

0 comments on commit 07ad3fc

Please sign in to comment.