| | |
| | | package cc.mrbird.febs.rabbit.consumer; |
| | | |
| | | import cc.mrbird.febs.dapp.service.DappSystemService; |
| | | import cc.mrbird.febs.rabbit.QueueConstants; |
| | | import com.rabbitmq.client.Channel; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.core.Message; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | @Autowired |
| | | private DappSystemService dappSystemService; |
| | | |
| | | @RabbitListener(queues = QueueConstants.ONLINE_TRANSFER) |
| | | public void onlineTransfer(String batchNo) { |
| | | log.info("收到链上转账消息:{}", batchNo); |
| | | dappSystemService.onlineTransfer(batchNo); |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.DISTRIB_PROFIT) |
| | | public void distrbProfit(String id) { |
| | | log.info("收到滑点分配消息:{}", id); |
| | | dappSystemService.tradeNftProfitDistribute(Long.parseLong(id)); |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.USER_BUY_REWARD) |
| | | public void userBuyReward(String id) { |
| | | log.info("收到用户购买奖励消息:{}", id); |
| | | dappSystemService.userBuyReward(Long.parseLong(id)); |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.NFT_BOX) |
| | | public void nftBox(String id) { |
| | | log.info("收到nft盲盒消息:{}", id); |
| | | dappSystemService.boxCnt(Long.parseLong(id)); |
| | | } |
| | | // /** |
| | | // * speed 支付订单 |
| | | // */ |
| | | // @RabbitListener(queues = QueueConstants.QUEUE_SPEED_PAY_ORDER) |
| | | // public void speedPayOrderMsg(Long orderId) { |
| | | // log.info("speedPayOrderMsg:{}", orderId); |
| | | // try { |
| | | // dappSystemService.speedPayOrderMsg(orderId); |
| | | // } catch (Exception e) { |
| | | // log.error("speedPayOrderErr:", e); |
| | | // } |
| | | // } |
| | | // |
| | | // /** |
| | | // * speed 代理升级 |
| | | // */ |
| | | // @RabbitListener(queues = QueueConstants.QUEUE_SPEED_LEVEL_UP_TEAM) |
| | | // public void speedAutoLevelUpTeamMsg(Long memberId) { |
| | | // log.info("speedAutoLevelUpTeamMsg:{}", memberId); |
| | | // try { |
| | | // dappSystemService.speedAutoLevelUpTeamMsg(memberId); |
| | | // } catch (Exception e) { |
| | | // log.error("speedAutoLevelUpTeamErr:", e); |
| | | // } |
| | | // } |
| | | // |
| | | // /** |
| | | // * speed 代理升级 |
| | | // */ |
| | | // @RabbitListener(queues = QueueConstants.QUEUE_SPEED_LEVEL_UP) |
| | | // public void speedAutoLevelUpMsg(Long memberId) { |
| | | // log.info("speedAutoLevelUpMsg:{}", memberId); |
| | | // try { |
| | | // dappSystemService.speedAutoLevelUpMsg(memberId); |
| | | // } catch (Exception e) { |
| | | // log.error("speedAutoLevelUpErr:", e); |
| | | // } |
| | | // } |
| | | // |
| | | // /** |
| | | // * speed 直推返利 |
| | | // */ |
| | | // @RabbitListener(queues = QueueConstants.QUEUE_SPEED_DIRECT_PERK) |
| | | // public void speedDirectPerkMsg(Long memberId) { |
| | | // log.info("speedDirectPerkMsg:{}", memberId); |
| | | // try { |
| | | // dappSystemService.speedDirectPerkMsg(memberId); |
| | | // } catch (Exception e) { |
| | | // log.error("speedDirectPerkErr:", e); |
| | | // } |
| | | // } |
| | | // |
| | | // /** |
| | | // * speed 卖出资产 |
| | | // */ |
| | | // @RabbitListener(queues = QueueConstants.QUEUE_SPEED_SALE_PACKAGE) |
| | | // public void speedSalePackageMsg(Long flowId) { |
| | | // log.info("speedSalePackageMsg:{}", flowId); |
| | | // try { |
| | | // dappSystemService.speedSalePackageMsg(flowId); |
| | | // } catch (Exception e) { |
| | | // log.error("speedSalePackageErr:", e); |
| | | // } |
| | | // } |
| | | } |