New file |
| | |
| | | package com.xcong.excoin.rabbit.consumer; |
| | | |
| | | import com.rabbitmq.client.Channel; |
| | | import com.xcong.excoin.configurations.RabbitMqConfig; |
| | | import com.xcong.excoin.modules.yunding.service.XchProfitService; |
| | | 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; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "app", name = "yunding-consumer", havingValue = "true") |
| | | public class YunDingConsumer { |
| | | |
| | | @Autowired |
| | | private XchProfitService xchProfitService; |
| | | |
| | | @RabbitListener(queues = RabbitMqConfig.QUEUE_XCH_USDT_PRIFIT) |
| | | public void addFollowOrder(Message message, Channel channel) { |
| | | String content = new String(message.getBody()); |
| | | log.info("USDT返利 : {}", content); |
| | | xchProfitService.usdtProfitDistributorByOrderId(Long.parseLong(content)); |
| | | } |
| | | } |