|
|
|
@ -1,23 +1,18 @@ |
|
|
|
|
package com.blockchain.server.eth.controller; |
|
|
|
|
|
|
|
|
|
import com.blockchain.common.base.constant.BaseConstant; |
|
|
|
|
import com.blockchain.common.base.dto.ResultDTO; |
|
|
|
|
import com.blockchain.common.base.dto.SessionUserDTO; |
|
|
|
|
import com.blockchain.common.base.exception.RPCException; |
|
|
|
|
import com.blockchain.common.base.util.SSOHelper; |
|
|
|
|
import com.blockchain.server.eth.common.enums.EthWalletEnums; |
|
|
|
|
import com.blockchain.server.eth.common.exception.EthWalletException; |
|
|
|
|
import com.blockchain.server.eth.controller.api.EthTokenApi; |
|
|
|
|
import com.blockchain.server.eth.controller.api.EthWalletApi; |
|
|
|
|
import com.blockchain.server.eth.entity.EthWalletTransfer; |
|
|
|
|
import com.blockchain.server.eth.feign.UserFeign; |
|
|
|
|
import com.blockchain.server.eth.service.IEthTokenService; |
|
|
|
|
import com.blockchain.server.eth.service.IEthWalletKeyService; |
|
|
|
|
import com.blockchain.server.eth.service.IEthWalletService; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
|
import org.apache.tomcat.jni.User; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
@ -43,6 +38,8 @@ public class EthWalletController { |
|
|
|
|
private UserFeign userFeign; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(EthWalletController.class); |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = EthWalletApi.GetWallet.METHOD_API_NAME, notes = EthWalletApi.GetWallet.METHOD_API_NOTE) |
|
|
|
|
@GetMapping("/getWallet") |
|
|
|
|
public ResultDTO getWallet( |
|
|
|
@ -95,13 +92,14 @@ public class EthWalletController { |
|
|
|
|
@ApiParam(EthWalletApi.SaveWalletPass.METHOD_API_CODE) @RequestParam(name = "code", required = false) String code, |
|
|
|
|
HttpServletRequest request) { |
|
|
|
|
SessionUserDTO user = SSOHelper.getUser(redisTemplate, request); |
|
|
|
|
ResultDTO resultDTO = userFeign.validateSmsg(code, user.getTel()); |
|
|
|
|
/* ResultDTO resultDTO = userFeign.validateSmsg(code, user.getTel()); |
|
|
|
|
if (resultDTO == null) { |
|
|
|
|
throw new EthWalletException(EthWalletEnums.SERVER_IS_TOO_BUSY); |
|
|
|
|
} |
|
|
|
|
if (resultDTO.getCode() != BaseConstant.REQUEST_SUCCESS) { |
|
|
|
|
throw new RPCException(resultDTO.getCode(), resultDTO.getMsg()); |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
LOG.info(" user yyyfUserId : "+ user.getYyyfUserId()); |
|
|
|
|
ethWalletService.updatePassword(user.getId(), password); |
|
|
|
|
return ResultDTO.requstSuccess(); |
|
|
|
|
} |
|
|
|
|