From 9271b536b0e370441f61664e8582837e337da6b9 Mon Sep 17 00:00:00 2001 From: liushaodong Date: Thu, 7 Nov 2019 17:05:45 +0800 Subject: [PATCH] =?UTF-8?q?eth=E5=85=85=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/eth/controller/EthWalletController.java | 3 ++- .../blockchain/server/eth/service/IEthWalletService.java | 2 +- .../server/eth/service/impl/EthWalletServiceImpl.java | 6 ++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/controller/EthWalletController.java b/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/controller/EthWalletController.java index 896285a..2166f7f 100644 --- a/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/controller/EthWalletController.java +++ b/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/controller/EthWalletController.java @@ -153,7 +153,8 @@ public class EthWalletController { @ApiParam(EthWalletApi.ResetWallet.TOKENID) @RequestParam("tokenId") String tokenId, @ApiParam(EthWalletApi.ResetWallet.WALLET_TYPE) @RequestParam(value = "walletType") String walletType) { String userOpenId = SSOHelper.getUserId(redisTemplate, request); - return ResultDTO.requstSuccess(ethWalletService.resetWallet(userOpenId, addr, tokenId, walletType)); + ethWalletService.resetWallet(userOpenId, addr, tokenId, walletType); + return ResultDTO.requstSuccess(); } } diff --git a/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/service/IEthWalletService.java b/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/service/IEthWalletService.java index a0f9f2a..ddefc80 100644 --- a/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/service/IEthWalletService.java +++ b/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/service/IEthWalletService.java @@ -206,5 +206,5 @@ public interface IEthWalletService { */ EthWalletTransfer handleTransfer(String userId,String fromType, String toType, String coinName, BigDecimal amount); - EthWalletDTO resetWallet(String userOpenId, String addr, String tokenId, String walletType); + void resetWallet(String userOpenId, String addr, String tokenId, String walletType); } diff --git a/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/service/impl/EthWalletServiceImpl.java b/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/service/impl/EthWalletServiceImpl.java index 13c996b..41cc401 100644 --- a/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/service/impl/EthWalletServiceImpl.java +++ b/blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/service/impl/EthWalletServiceImpl.java @@ -416,20 +416,18 @@ public class EthWalletServiceImpl implements IEthWalletService, ITxTransaction { } @Override - public EthWalletDTO resetWallet(String userOpenId, String addr, String tokenId, String walletType) { + public void resetWallet(String userOpenId, String addr, String tokenId, String walletType) { WalletInitConfig walletInitConfig = new WalletInitConfig(); walletInitConfig.setCoin(tokenId); walletInitConfig.setWalletType(walletType); WalletInitConfig config = walletInitConfigMapper.selectOne(walletInitConfig); - ethWalletMapper.updateWalletBalanceByUserOpenId(config.getBalance(),userOpenId,tokenId,walletType,new Date()); if(config==null || config.getBalance()==null){ throw new EthWalletException(EthWalletEnums.RESET_ERROR); } + ethWalletMapper.updateWalletBalanceByUserOpenId(config.getBalance(),userOpenId,tokenId,walletType,new Date()); - EthWalletDTO walletDTO = selectByAddrAndTokenAddrAndWalletType(addr, addr, walletType); - return walletDTO; } /**