Commit 489ec57f authored by tangtuo's avatar tangtuo

注册用户时给用户生成默认昵称

删除无用代码
parent da3689dd
......@@ -35,7 +35,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Array;
import java.util.*;
import java.util.stream.Collectors;
......@@ -182,22 +181,6 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
return true;
}
public Boolean checkResult(String nftHash) {
TxResult txResult = paraChainClient.confirmTxWithGrpTxHash(nftHash);
if (TxStatusEnum.RUNNING.equals(txResult.getStatus())) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
checkResult(nftHash);
}
if (TxStatusEnum.FAIL.equals(txResult.getStatus())) {
throw GlobalException.newException(ResultCode.FAILED, String.format("nft发行失败,原因是:{}", txResult.getErrMsg()));
}
return true;
}
@Override
public List<Nft> list(Integer pageNum, Integer pageSize, Integer categoryId) {
return nftMapper.list(pageNum, pageSize, categoryId);
......
......@@ -5,6 +5,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.constant.SystemConstant;
......@@ -92,6 +93,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
throw GlobalException.newException(ResultCode.UNAUTHORIZED, "注册失败,生成区块链钱包异常,请稍后再试");
}
registerUser.setWallet(wallet);
// 用户注册时生成默认昵称
String nickname = "JOYING-" + RandomUtil.randomInt(100000, 999999);
registerUser.setNickname(nickname);
if (StringUtils.isNotBlank(param.getPassword())) {
registerUser.setPassword(passwordEncoder.encode(param.getPassword()));
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment