修复资金密码设置问题

master
huan.xu 5 years ago
parent e8824d8b65
commit a36cb7c7b5
  1. 16
      blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/controller/EthWalletController.java
  2. 10
      blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/service/impl/UserMainServiceImpl.java

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

@ -25,6 +25,8 @@ import com.blockchain.server.user.mapper.UserMainMapper;
import com.blockchain.server.user.service.*; import com.blockchain.server.user.service.*;
import com.codingapi.tx.annotation.TxTransaction; import com.codingapi.tx.annotation.TxTransaction;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -59,6 +61,7 @@ public class UserMainServiceImpl implements UserMainService {
@Autowired @Autowired
private BtcFeign btcFeign; private BtcFeign btcFeign;
private static final Logger LOG = LoggerFactory.getLogger(UserMainServiceImpl.class);
@Override @Override
public UserMain selectByMobilePhone(String tel) { public UserMain selectByMobilePhone(String tel) {
@ -97,8 +100,8 @@ public class UserMainServiceImpl implements UserMainService {
userLoginService.insertEntity(userId, password);//插入密码信息 userLoginService.insertEntity(userId, password);//插入密码信息
int insertRow = userRelationService.insertRelationChain(userId, invitationCode);//插入推荐关系 int insertRow = userRelationService.insertRelationChain(userId, invitationCode);//插入推荐关系
userInfoService.saveUser(userId,tel, insertRow > 0);//插入用户其他信息 userInfoService.saveUser(userId,tel, insertRow > 0);//插入用户其他信息
LOG.info("生成钱包开始");
/* ResultDTO ethResult = ethFeign.initWallets(userId); ResultDTO ethResult = ethFeign.initWallets(userId);
if (ethResult.getCode() != BaseConstant.REQUEST_SUCCESS) { if (ethResult.getCode() != BaseConstant.REQUEST_SUCCESS) {
throw new RPCException(ethResult.getCode(), ethResult.getMsg()); throw new RPCException(ethResult.getCode(), ethResult.getMsg());
} }
@ -109,7 +112,8 @@ public class UserMainServiceImpl implements UserMainService {
ResultDTO btcResult = btcFeign.createWallet(userId); ResultDTO btcResult = btcFeign.createWallet(userId);
if (btcResult.getCode() != BaseConstant.REQUEST_SUCCESS) { if (btcResult.getCode() != BaseConstant.REQUEST_SUCCESS) {
throw new RPCException(btcResult.getCode(), btcResult.getMsg()); throw new RPCException(btcResult.getCode(), btcResult.getMsg());
}*/ }
LOG.info("生成钱包结束");
return user; return user;
} }

Loading…
Cancel
Save