AssetManager.API/AssetManager.Infrastructure/Services/IExchangeRateService.cs

25 lines
932 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace AssetManager.Infrastructure.Services;
/// <summary>
/// 汇率服务接口(预留,后续实现多币种汇总)
/// </summary>
public interface IExchangeRateService
{
/// <summary>
/// 获取汇率(从源币种转换为目标币种)
/// </summary>
/// <param name="fromCurrency">源币种(如 CNY</param>
/// <param name="toCurrency">目标币种(如 USD</param>
/// <returns>汇率1 单位源币种可兑换的目标币种数量)</returns>
Task<decimal> GetExchangeRateAsync(string fromCurrency, string toCurrency);
/// <summary>
/// 转换金额
/// </summary>
/// <param name="amount">金额</param>
/// <param name="fromCurrency">源币种</param>
/// <param name="toCurrency">目标币种</param>
/// <returns>转换后的金额</returns>
Task<decimal> ConvertAmountAsync(decimal amount, string fromCurrency, string toCurrency);
}