From 9f39688e52d5e750066753df3c1890ee4b799db5 Mon Sep 17 00:00:00 2001 From: iliad Date: Sat, 8 Feb 2025 11:25:41 +0800 Subject: [PATCH] feat: add etransfer api --- .../Controllers/TransferController.cs | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/src/EoaServer.HttpApi/Controllers/TransferController.cs b/src/EoaServer.HttpApi/Controllers/TransferController.cs index 8015957..c864fa3 100644 --- a/src/EoaServer.HttpApi/Controllers/TransferController.cs +++ b/src/EoaServer.HttpApi/Controllers/TransferController.cs @@ -4,6 +4,7 @@ using EoaServer.Transfer.Dtos; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Application.Dtos; namespace EoaServer.Controllers; @@ -15,10 +16,38 @@ namespace EoaServer.Controllers; public class TransferController : EoaServerBaseController { private readonly IShiftChainService _shiftChainService; + private readonly ITransferAppService _transferAppService; - public TransferController(IShiftChainService shiftChainService) + public TransferController(IShiftChainService shiftChainService, + ITransferAppService transferAppService) { _shiftChainService = shiftChainService; + _transferAppService = transferAppService; + } + + [HttpPost("connect/token")] + public async Task GetConnectTokenAsync([FromForm] AuthTokenRequestDto request) + { + return await _transferAppService.GetConnectTokenAsync(request); + } + + + [HttpGet("token/list")] + public async Task GetTokenListAsync(WithdrawTokenListRequestDto request) + { + return (await _transferAppService.GetTokenListAsync(request)).Data; + } + + [HttpGet("token/option")] + public async Task GetTokenOptionListAsync(GetTokenOptionListRequestDto request) + { + return (await _transferAppService.GetTokenOptionListAsync(request)).Data; + } + + [HttpGet("network/list")] + public async Task GetNetworkListAsync(GetNetworkListRequestDto request) + { + return (await _transferAppService.GetNetworkListAsync(request)).Data; } [HttpGet("getReceiveNetworkList")] @@ -33,4 +62,28 @@ public async Task GetDestinationList(GetSendNetworkListRequestDt { return (await _shiftChainService.GetSendNetworkList(request)).Data; } + + [HttpGet("deposit/calculator")] + public async Task CalculateDepositRateAsync(GetCalculateDepositRateRequestDto request) + { + return (await _transferAppService.CalculateDepositRateAsync(request)).Data; + } + + [HttpGet("deposit/info")] + public async Task GetDepositInfoAsync(GetDepositRequestDto request) + { + return (await _transferAppService.GetDepositInfoAsync(request)).Data; + } + + [HttpGet("network/tokens")] + public async Task GetNetworkTokensAsync(GetNetworkTokensRequestDto request) + { + return (await _transferAppService.GetNetworkTokensAsync(request)).Data; + } + + [HttpGet("record/list")] + public async Task> GetRecordListAsync(GetOrderRecordRequestDto request) + { + return (await _transferAppService.GetRecordListAsync(request)).Data; + } } \ No newline at end of file