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; } /**