| | |
| | | @PostMapping(value = "/boxSurprise") |
| | | public FebsResponse boxSurprise() { |
| | | int cnt = dappWalletService.boxSurprise(); |
| | | return new FebsResponse().success().message("获得卡牌:" + cnt + "张").data(cnt); |
| | | return new FebsResponse().success().data(cnt); |
| | | } |
| | | |
| | | // @ApiOperation(value = "记录列表", notes = "记录列表") |
| | |
| | | int i = (int) parentRecommend; |
| | | |
| | | // 如果超过10个,则新增一个盲盒,并重置推荐人数 |
| | | if (++i == 3) { |
| | | if (++i == 10) { |
| | | box = 1; |
| | | redisUtils.hset(AppContants.IDO_MEMBER_RECOMMEND_CNT, parent.getAddress(), 1); |
| | | redisUtils.hset(AppContants.IDO_MEMBER_RECOMMEND_CNT, parent.getAddress(), 0); |
| | | } else { |
| | | redisUtils.hset(AppContants.IDO_MEMBER_RECOMMEND_CNT, parent.getAddress(), i); |
| | | } |
| | |
| | | dappFundFlowDao.insert(boxFundFlow); |
| | | |
| | | new Thread(() -> { |
| | | try { |
| | | int count = box.getIndex(); |
| | | while(count > 0) { |
| | | log.info("卡牌+1"); |
| | | ChainService.getInstance(ChainEnum.BSC_NFT_SDC.name()).safeMintNFT(member.getAddress()); |
| | | Thread.sleep(5000); |
| | | count--; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("发放卡牌错误", e); |
| | | } |
| | | }).start(); |
| | | |
| | | return box.getIndex(); |
| | |
| | | List<Box> boxList = JSONObject.parseArray(redisStr, Box.class); |
| | | if (CollUtil.isEmpty(boxList)) { |
| | | boxList = Collections.synchronizedList(new ArrayList<>()); |
| | | Box box1 = new Box(1, 6); |
| | | Box box2 = new Box(2, 1); |
| | | Box box3 = new Box(3, 1); |
| | | Box box1 = new Box(1, 91); |
| | | Box box2 = new Box(2, 4); |
| | | Box box3 = new Box(3, 3); |
| | | Box box4 = new Box(4, 1); |
| | | Box box5 = new Box(5, 1); |
| | | boxList.add(box1); |