fix: 修复银行汇率问题
This commit is contained in:
@@ -9,11 +9,15 @@ using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace Yi.Framework.Bbs.Domain.Managers.BankValue
|
||||
{
|
||||
[Dependency(TryRegister =true)]
|
||||
[Dependency(TryRegister = true)]
|
||||
public class BiyingBankValueProvider : IBankValueProvider, ITransientDependency
|
||||
{
|
||||
//官网地址:www.biyingapi.com
|
||||
private const string Url = "https://api.biyingapi.com/hsrl/ssjy/600519/5579aa4b391945678";
|
||||
|
||||
public decimal StandardValue => 1700;
|
||||
|
||||
|
||||
public async Task<decimal> GetValueAsync()
|
||||
{
|
||||
try
|
||||
@@ -27,9 +31,10 @@ namespace Yi.Framework.Bbs.Domain.Managers.BankValue
|
||||
return jsonObject["p"].Value<decimal>();
|
||||
}
|
||||
}
|
||||
catch(Exception ex) {
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("BiyingBank获取数据异常", ex);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,16 @@ namespace Yi.Framework.Bbs.Domain.Managers.BankValue
|
||||
{
|
||||
public interface IBankValueProvider
|
||||
{
|
||||
public Task<decimal> GetValueAsync();
|
||||
/// <summary>
|
||||
/// 标准值
|
||||
/// </summary>
|
||||
decimal StandardValue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取第三方值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<decimal> GetValueAsync();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace Yi.Framework.Bbs.Domain.Managers.BankValue
|
||||
{
|
||||
[Dependency(ReplaceServices = true)]
|
||||
internal class RandownBankValueProvider : IBankValueProvider, ITransientDependency
|
||||
{
|
||||
public decimal StandardValue => 1000;
|
||||
|
||||
|
||||
public Task<decimal> GetValueAsync()
|
||||
{
|
||||
var currentNumber = new Random().Next(800, 1200);
|
||||
|
||||
Reference in New Issue
Block a user