Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed Mar 8, 2024
1 parent d6dc0db commit 659d2e8
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 32 deletions.
8 changes: 0 additions & 8 deletions .github/RELEASE_TEMPLATE.md

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,6 @@ jobs:
with:
name: win-arm64
path: out

- name: Create ${{ env.PROJECT_NAME }} GitHub release
id: github_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ env.PROJECT_NAME }} ${{ github.ref_name }}
prerelease: true
body_path: .github/RELEASE_TEMPLATE.md



- name: Create ${{ env.PROJECT_NAME }} GitHub release
uses: ncipollo/release-action@v1.12.0
Expand Down
27 changes: 25 additions & 2 deletions ASFEnhanceTools/Data/PurchaseResponse.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
namespace ASFEnhanceTools.Data
namespace ASFEnhanceTools.Data
{
internal sealed record PurchaseResponse : AbstractResponse<IDictionary<string, bool>>
internal sealed record PurchaseResponse : AbstractResponse<IDictionary<string, PurchaseResponse.ResultData>>
{
public sealed record ResultData
{
/// <summary>
/// 是否成功
/// </summary>
public bool Success { get; set; }
/// <summary>
/// 花费
/// </summary>
public long Cost { get; set; }
/// <summary>
/// 货币
/// </summary>
public string? Currency { get; set; }
/// <summary>
/// 购物前余额
/// </summary>
public long BalancePrev { get; set; }
/// <summary>
/// 购物后余额
/// </summary>
public long BalanceNow { get; set; }
}
}
}
10 changes: 5 additions & 5 deletions ASFEnhanceTools/Forms/FormClient.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions ASFEnhanceTools/Forms/FormClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ASFEnhanceTools.Data;
using ASFEnhanceTools.Data;
using ASFEnhanceTools.Extensions;

using System.Net.Http.Json;
Expand Down Expand Up @@ -369,9 +369,12 @@ private async Task DoPurchase(bool fakePurchase)
{
StringBuilder sb = new();

if (response.Result.TryGetValue(bot.BotName, out var result))
if (response.Result.TryGetValue(bot.BotName, out var result) && result != null)
{
sb.AppendLine(string.Format("结算结果: {0}", result ? Langs.Success : Langs.Failed));
sb.AppendLine(string.Format("结算结果: {0}", result.Success ? Langs.Success : Langs.Failed));
sb.AppendLine(string.Format("花费: {0} {1}", result.Cost, result.Currency));
sb.AppendLine(string.Format("购物前余额: {0} {1}", result.BalancePrev, result.Currency));
sb.AppendLine(string.Format("购物后余额: {0} {1}", result.BalanceNow, result.Currency));
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>1.1.0.0</Version>
<Version>1.1.0.1</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 659d2e8

Please sign in to comment.